Module: Kaminari::ConfigurationMethods::ClassMethods
- Defined in:
- lib/kaminari/models/configuration_methods.rb
Instance Method Summary collapse
-
#default_per_page ⇒ Object
This model’s default per_page value returns 25 unless explicitly overridden via
paginates_per
. -
#paginates_per(val) ⇒ Object
Overrides the default per_page value per model class Article < ActiveRecord::Base paginates_per 10 end.
Instance Method Details
#default_per_page ⇒ Object
This model’s default per_page value returns 25 unless explicitly overridden via paginates_per
15 16 17 |
# File 'lib/kaminari/models/configuration_methods.rb', line 15 def default_per_page @_default_per_page || Kaminari::DEFAULT_PER_PAGE end |
#paginates_per(val) ⇒ Object
Overrides the default per_page value per model
class Article < ActiveRecord::Base
paginates_per 10
end
9 10 11 |
# File 'lib/kaminari/models/configuration_methods.rb', line 9 def paginates_per(val) @_default_per_page = val end |