Module: ActiveAdmin::Resource::Pagination

Included in:
ActiveAdmin::Resource
Defined in:
lib/active_admin/resource/pagination.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#max_per_pageObject

The default number of records to display per page


11
12
13
# File 'lib/active_admin/resource/pagination.rb', line 11

def max_per_page
  @max_per_page
end

#paginateObject

Enable / disable pagination (defaults to true)


14
15
16
# File 'lib/active_admin/resource/pagination.rb', line 14

def paginate
  @paginate
end

#per_pageObject

The default number of records to display per page


8
9
10
# File 'lib/active_admin/resource/pagination.rb', line 8

def per_page
  @per_page
end

Instance Method Details

#initialize(*args) ⇒ Object


16
17
18
19
20
21
# File 'lib/active_admin/resource/pagination.rb', line 16

def initialize(*args)
  super
  @paginate = true
  @per_page = namespace.default_per_page
  @max_per_page = namespace.max_per_page
end