Pagy
Pagy is fully supported but entirely optional. The engine works without any pagination system.
When Pagy is installed
The engine automatically detects Pagy and provides:
Pagy::Methodincluded in controllers automatically- A
PagyHelperfor rendering styled page navigation - Styled pagination controls that match the theme
Installation
Add Pagy to your application:
bundle add pagy
If you want to modify the number of items per page (default is 20), create an initializer at config/initializers/pagy.rb:
Pagy::DEFAULT[:limit] = 20
Helper methods
The pagination helper provides:
| Helper | Description |
|---|---|
l_ui_pagy |
Renders styled pagination links from a Pagy instance |
Example
See the pagination page for a live example with Pagy in action.