Module: FetcheableOnApi::Pageable

Defined in:
lib/fetcheable_on_api/pageable.rb

Overview

Pageable implements pagination support.

It handles the controller parameters:

  • page[:number] the requested page (default: 1).

  • page[:size] number of records per page.

If no page parameter is present on the request, the full collection is returned.

The following pagination information is add to the response headers:

  • Pagination-Current-Page the page that is returned.

  • Pagination-Per the number of records included in the page.

  • Pagination-Total-Pages the total number of pages available.

  • Pagination-Total-Count the total number of records available.