Module: SimpleCrud::Pagination::Adapter
- Included in:
- KaminariAdapter, PagyAdapter, WillPaginateAdapter, WorPaginateAdapter
- Defined in:
- lib/simple_crud/pagination/adapter.rb
Overview
Implement to plug in a pagination library other than wor-paginate (the default, see WorPaginateAdapter).
Instance Method Summary collapse
-
#paginate(controller, relation, options) ⇒ Object
Called when paginate: true.
-
#paginated_records(controller, relation, options) ⇒ Object
Called when rendering :index as HTML (html: true or a block given) and paginate: true.
Instance Method Details
#paginate(controller, relation, options) ⇒ Object
Called when paginate: true. Must render the response itself.
9 10 11 |
# File 'lib/simple_crud/pagination/adapter.rb', line 9 def paginate(controller, relation, ) raise NotImplementedError end |
#paginated_records(controller, relation, options) ⇒ Object
Called when rendering :index as HTML (html: true or a block given) and paginate: true. Must return the current page's records without rendering.
15 16 17 |
# File 'lib/simple_crud/pagination/adapter.rb', line 15 def paginated_records(controller, relation, ) raise NotImplementedError end |