Module: Transit::Model::Paginator::ClassMethods
- Defined in:
- lib/transit/model/paginator.rb
Instance Method Summary collapse
-
#deliver_per_page(*opts) ⇒ Object
Sets the default number of items per-page.
- #pagination_options ⇒ Object
Instance Method Details
#deliver_per_page(*opts) ⇒ Object
Sets the default number of items per-page. Allows setting the option for both “admin” / management pages as well as a default for front-end pages.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/transit/model/paginator.rb', line 25 def deliver_per_page(*opts) = opts. if .empty? .merge!(default: opts.first, admin: opts.first) else .merge!() end unless opts.empty? .merge!(default: opts.first) unless opts.first.nil? end end |
#pagination_options ⇒ Object
37 38 39 |
# File 'lib/transit/model/paginator.rb', line 37 def @_pagination_options ||= { default: 10, admin: 20 } end |