#
In
#
:countless
:countless
is an OFFSET paginator that avoids the COUNT
query, reducing the number of queries per request by one.
Consider using the :keynav_js
paginator when possible!
The :keynav_js offers identical UI features but utilizes the faster keyset
pagination.
Controller
@pagy, @records = pagy(:countless, collection, **options)
@pagy
is the pagination instance. It provides thereaders and the helpers to use in your code.@records
represents the eager-loadedArray
of records for the page.
headless: true
- Use this option when UI is unnecessary (e.g., for infinite scrolling) and/or to skip eager loading. In this scenario:
@pagy
is incompatible with any helpers.@records
behaves like a standard collection.- The collection ends when
@records.size < @pagy.limit
.
- Use this option when UI is unnecessary (e.g., for infinite scrolling) and/or to skip eager loading. In this scenario:
See also Offset Options
See Offset Readers
Nav bar links beyond the last or highest visited page are not displayed.