#
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)
@pagyis the pagination instance. It provides thereaders and the helpers to use in your code.@recordsrepresents the eager-loadedArrayof 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:
@pagyis incompatible with any helpers.@recordsbehaves 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.