Kaminari is a pagination library for Ruby web applications that provides scope and engine-based pagination across multiple ORMs and frameworks.
The tool solves the problem of paginating large datasets by offering a clean, chainable API built on database scopes rather than custom collection classes. It works by adding `page` and `per` scope methods to models, allowing developers to paginate results with simple method chains like `User.page(2).per(50)`. The pagination helper renders HTML5 navigation elements through customizable partial templates, making it easy to modify styling and behavior without touching core logic.
Developers should choose Kaminari if they need pagination that integrates seamlessly with existing query chains and doesn't pollute core Ruby classes. It suits Rails applications most naturally, but also works with Sinatra, Grape, and non-Rails frameworks. The tool supports multiple ORMs including ActiveRecord, Mongoid, DataMapper, and MongoMapper, and multiple template engines including ERB, Haml, and Slim. Unlike some pagination solutions that require special collection classes, Kaminari returns standard ActiveRecord relations, preserving the ability to chain additional conditions before or after pagination.
The project maintains active support across a wide range of Ruby and Rails versions. Development activity shows consistent engagement with the codebase through regular updates and testing infrastructure. The tool has been refined to handle edge cases like padding records to page boundaries and provides utilities for unscoping pagination when needed. The project's scope-based design reflects a commitment to modern Rails patterns and method chaining conventions.