Module: Undercarriage::Controllers::KaminariConcern
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/undercarriage/controllers/kaminari_concern.rb
Overview
Kaminari pagination
Helpers for Kaminari style pagination. Note that the Kaminari gem is not loaded with dependency. It must be added to your own Gemfile
Instance Method Summary collapse
-
#page_num ⇒ Integer
Page number.
-
#per_page ⇒ Integer
Items per page.
Instance Method Details
#page_num ⇒ Integer
Page number
Will look for the Kaminari config param_name (typically page) in the URL paramaters.
This is asseccible from the View as page_num
56 57 58 |
# File 'lib/undercarriage/controllers/kaminari_concern.rb', line 56 def page_num params.fetch(page_num_key, page_num_default).to_i end |
#per_page ⇒ Integer
Items per page
The number of items to return in pagination. Will use the Kaminari config default_per_page (typically 25)
for the count and will look for per in the URL paramaters to override.
This is asseccible from the View as per_page
40 41 42 |
# File 'lib/undercarriage/controllers/kaminari_concern.rb', line 40 def per_page params.fetch(per_page_key, per_page_default).to_i end |