Sha256: 06c155ba90a6b61559828b960495ef487b139f85c04ad8272f8635246fe2a2b3
Contents?: true
Size: 1.06 KB
Versions: 21
Compression:
Stored size: 1.06 KB
Contents
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 [:get, :post] end register_instance_option :controller do proc do if format = params[:json] && :json || params[:csv] && :csv || params[:xml] && :xml 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 'icon-share' end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems