views:

34

answers:

1

Hi, I'm new to rails and I want to know about paginate method in rails. How can I do pagination in rails. Thanks

+2  A: 

Take a look at the http://github.com/mislav/will_paginate (gem/plugin)

cloverink
see more http://railscasts.com/episodes/51-will-paginate
cloverink
This is my controller's index action where I am trying to list all pages using paginate. @pages = Page.paginate :page => params[:page] But I got an error "undefined method `paginate "
Did you install this plugin ?
cloverink
Have you got at the bottom of your environment.rb file the line:require 'will_paginate'
cloverink
@cloverink You don't need to require it if you use the Rails gem dependency system.
Simone Carletti