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.

Source | Google | Stack overflow

Edit

git clone [email protected]:mislav/will_paginate.git

cd will_paginate

open lib/will_paginate/collection.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-WillPaginate--Collection-offset-for-pr


# Commit to git

git add lib/will_paginate/collection.rbgit commit -m "better docs for WillPaginate::Collection#offset"


# Open pull request

gem 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!