Sha256: aa2fe8900e53a92dff20d9fcc872ace73ebba2790afb4fee5d1d6d842c1c66c8

Contents?: true

Size: 1 KB

Versions: 29

Compression:

Stored size: 1 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.new do

            if format = params[:json] && :json || params[:csv] && :csv || params[:xml] && :xml
              request.format = format
              @schema = params[:schema].symbolize 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

29 entries across 29 versions & 5 rubygems

Version Path
rails_admin-0.6.0 lib/rails_admin/config/actions/export.rb
rails_admin-0.5.0 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.9 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.8 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.7 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.6 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.5 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.4 lib/rails_admin/config/actions/export.rb
rails_admin-lbgraham-0.4.2 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.3 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.2 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.1 lib/rails_admin/config/actions/export.rb
rails_admin-0.4.0 lib/rails_admin/config/actions/export.rb
rails_admin-0.3.0 lib/rails_admin/config/actions/export.rb
rails_admin-0.2.0 lib/rails_admin/config/actions/export.rb
rails_admin-0.1.2 lib/rails_admin/config/actions/export.rb
rails_admin-0.1.1 lib/rails_admin/config/actions/export.rb
rails_admin-0.1.0 lib/rails_admin/config/actions/export.rb
rails_admin-0.0.5 lib/rails_admin/config/actions/export.rb
rails_admin-0.0.4 lib/rails_admin/config/actions/export.rb