// the find
ddnexus/pagy
Agnostic pagination in plain ruby
Pagy is a pagination gem for Ruby that works across Rails, Sinatra, Hanami, Padrino, and plain Rack apps. It supports offset, keyset, countish, countless, calendar, and search engine pagination in a single library. If you're paginating anything in Ruby and not using Pagy, you're probably allocating 35x more objects than you need to.
The benchmark numbers are not marketing fluff — the object count difference versus will_paginate/kaminari is real and comes from Pagy's architecture of plain Ruby objects with no ActiveSupport bloat. Keyset pagination (cursor-based) is first-class, not bolted on, which means large tables don't fall apart at page 500. The autoloading approach means you only pay for what you actually use — if you never render a Bootstrap nav, that code never loads. E2E test coverage with recorded HTML snapshots catches regressions across CSS frameworks that pure unit tests miss entirely.
Version 43 is a complete API break from prior versions — the upgrade guide exists, but existing apps on v6/v7 face non-trivial migration work since the include pattern, helper names, and configuration all changed. The 'Pagy AI' dev tool embedded in the page is a gimmick that adds an outbound network dependency to your development environment, which is the wrong place for that feature. Calendar pagination, while genuinely useful, requires combining three paginator instances that need to stay in sync, and the failure modes when they fall out of sync are not well documented. Search engine adapters (Elasticsearch, Meilisearch, Searchkick, Typesense) are thin wrappers with limited testing against real search backends — you'll discover edge cases yourself.