Module: Care::AutoFinder::Paginateble
- Defined in:
- lib/care/auto_finder/paginateble.rb
Overview
Содержит методы для пагинации коллекции
Constant Summary collapse
- DEFAULT_LIMIT =
100
Instance Method Summary collapse
Instance Method Details
#by_page(items) ⇒ Object
22 23 24 |
# File 'lib/care/auto_finder/paginateble.rb', line 22 def by_page(items) params[:page].present? ? items.page(params[:page]).per(params[:limit] || DEFAULT_LIMIT) : items end |
#paginate(items) ⇒ Object
26 27 28 |
# File 'lib/care/auto_finder/paginateble.rb', line 26 def paginate(items) by_page(items) end |