Skip to content
API/RansackResponseOptions

RansackResponseOptions

src/models/response-options.tsclass

Pre-configured ResponseOptions for the Ransack (Rails) driver

Ransack does not paginate, so the response is whatever the pagination gem sends: a bare-array body with the metadata in headers. Unlike every other subclass, currentPage, lastPage, perPage and total name response headers, not body paths. They default to the headers of Pagy’s headers_hash (current-page, total-pages, page-limit, total-count); when one is absent the strategy falls back to api-pagination’s (page, per-page, total), so Kaminari works unconfigured. Navigation URLs come from the link header, so the URL paths default to empty strings, as do from/to, which are derived. data is a body path, read only when the body is not a bare array.

new RansackResponseOptions(options: PaginationConfig)
Parameter Type Description
options PaginationConfig —
Property Type Description
currentPage string —
data string —
firstPageUrl string —
from string —
lastPage string —
lastPageUrl string —
nextPageUrl string —
path string —
perPage string —
prevPageUrl string —
to string —
total string —