Re: how to paginate an model array object

Ratnavel Sundaramurthi
Wed, 19 Dec 2007 09:23:25 -0000

In controller:

@models = Model.paginate :page => params[:page], :per_page => PAGE_SIZE,
:conditions => yr_condition

In View:

 <%= will_paginate @models %>

Before this as a first step install will_paginate plugin since
pagination concept is removed from core rails 2.0 and released as a
plugin

U can install the plugin by typing this navigating to the project folder

(example:
E:\My Rails Application>ruby script/plugin install
svn://errtheblog.com/svn/plugins/will_paginate)