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

Instance Method Details

#paginate(controller, relation, options) ⇒ Object

Called when paginate: true. Must render the response itself.

Raises:

  • (NotImplementedError)


9
10
11
# File 'lib/simple_crud/pagination/adapter.rb', line 9

def paginate(controller, relation, options)
  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.

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/simple_crud/pagination/adapter.rb', line 15

def paginated_records(controller, relation, options)
  raise NotImplementedError
end