will_paginate
https://github.com/mislav/will_paginate
Ruby
Pagination library for Rails and other Ruby applications
WillPaginate::Collection#offset
Current offset of the paginated collection. If we're on the first page, it is always 0. If we're on the 2nd page and there are 30 entries per page, the offset is 30. This property is useful if you want to render ordinals side by side with records in the view: simply start with offset + 1.
Edit
git clone [email protected]:mislav/will_paginate.git
cd will_paginate
open lib/will_paginate/collection.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-WillPaginate--Collection-offset-for-pr
# Commit to gitgit add lib/will_paginate/collection.rbgit commit -m "better docs for WillPaginate::Collection#offset"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-WillPaginate--Collection-offset-for-pr
hub pull-request
# Celebrate!