module WillPaginate::ActionView

ActionView helpers ↑

This module serves for availability in ActionView templates. It also adds a new view helper: paginated_section.

Using the helper without arguments ↑

If the helper is called without passing in the collection object, it will try to read from the instance variable inferred by the controller name. For example, calling will_paginate while the current controller is PostsController will result in trying to read from the @posts variable. Example:

<%= will_paginate :id => true %>

… will result in @post collection getting paginated:

<div class="pagination" id="posts_pagination"> ... </div>