Sha256: 29a3c4a786558a938256efe487b90daeccec5047bb815b1c079e201d02d99551
Contents?: true
Size: 1.12 KB
Versions: 13
Compression:
Stored size: 1.12 KB
Contents
# frozen_string_literal: true module RailsAdmin module Config module Actions class Export < RailsAdmin::Config::Actions::Base RailsAdmin::Config::Actions.register(self) register_instance_option :collection do true end register_instance_option :http_methods do %i[get post] end register_instance_option :controller do proc do format = params[:json] && :json || params[:csv] && :csv || params[:xml] && :xml if format request.format = format @schema = HashHelper.symbolize(params[:schema].slice(:except, :include, :methods, :only).permit!.to_h) if params[:schema] # to_json and to_xml expect symbols for keys AND values. @objects = list_entries(@model_config, :export) index else render @action.template_name end end end register_instance_option :bulkable? do true end register_instance_option :link_icon do 'fas fa-file-export' end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems