module WillPaginate::ActiveRecord
Paginating finders for ActiveRecord models¶ ↑
WillPaginate adds paginate
,
per_page
and other methods to ActiveRecord::Base class methods
and associations.
In short, paginating finders are equivalent to ActiveRecord finders; the only difference is
that we start with “paginate” instead of “find” and that :page
is required parameter:
@posts = Post.paginate :all, :page => params[:page], :order => 'created_at DESC'