Fast and simple object pagination for Rails.
Add this line to your application's Gemfile:
gem 'quill'
And then execute:
$ bundle
Or install it yourself as:
$ gem install quill
At this point it's pretty similar to the Kaminari gem, on which this project is based on and inspired by.
User.qpage(1)
User.qpage(2)
User.qpage(1).next_page?
User.qpage(2).previous_page?
To display the pagination links:
<%= qpaginate(@users) %>
You can set up the following configuration options:
default_per_page - number of items per page (20 by default)
- View generators for the pagination fragments.
- Cache all the things!
Hit me up here or by email (davidjairala@gmail.com) or in my blog.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request