Module: ActiveAdmin::ResourceController::Collection::Pagination

Included in:
ActiveAdmin::ResourceController::Collection
Defined in:
lib/active_admin/resource_controller/collection.rb

Instance Method Summary collapse

Instance Method Details

#active_admin_collectionObject (protected)



119
120
121
# File 'lib/active_admin/resource_controller/collection.rb', line 119

def active_admin_collection
  paginate(super)
end

#paginate(chain) ⇒ Object (protected)



128
129
130
# File 'lib/active_admin/resource_controller/collection.rb', line 128

def paginate(chain)
  chain.page(params[:page]).per(@per_page || active_admin_application.default_per_page)
end

#setup_pagination_for_csvObject (protected)

Allow more records for csv files



124
125
126
# File 'lib/active_admin/resource_controller/collection.rb', line 124

def setup_pagination_for_csv
  @per_page = 10_000 if request.format == 'text/csv'
end