will_paginate
https://github.com/mislav/will_paginate
Ruby
Pagination library for Rails and other Ruby applications
WillPaginate::ActionView#paginated_section
Wrapper for rendering pagination links at both top and bottom of a block
of content.
<% paginated_section @posts do %>
<ol id="posts">
<% for post in @posts %>
<li> ... </li>
<% end %>
</ol>
<% end %>
will result in:
<div class="pagination"> ... </div>
<ol id="posts">
...
</ol>
<div class="pagination"> ... </div>
Arguments are passed to a <tt>will_paginate</tt> call, so the same options
apply. Don't use the <tt>:id</tt> option; otherwise you'll finish with two
blocks of pagination links sharing the same ID (which is invalid HTML).Edit
git clone [email protected]:mislav/will_paginate.git
cd will_paginate
open lib/will_paginate/view_helpers/action_view.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-WillPaginate--ActionView-paginated_section-for-pr
# Commit to gitgit add lib/will_paginate/view_helpers/action_view.rbgit commit -m "better docs for WillPaginate::ActionView#paginated_section"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-WillPaginate--ActionView-paginated_section-for-pr
hub pull-request
# Celebrate!