Xclusive
Xclusive

Reputation: 51

Having problems with my will_paginate after upgrading to Rails 3

The problem is that I keep getting

NoMethodError (undefined method `paginate' for #<Class:0x1e3dec0>):
activerecord (3.0.3) lib/active_record/base.rb:1008:in `method_missing'

Below is the code snippet I am including and any help in fixing my problem. I am using will_paginate-rails3 at the moment.

def list
   @users = User.paginate :per_page => 10, :page => 1
end

in user_controller.rb

and also

<!-<%= link_to 'Previous page', { :page => @users.previous_page } if @users.previous_page %>-->

in my views.html.

Could someone please point me in the right direction?

Upvotes: 2

Views: 1657

Answers (1)

Brian Morearty
Brian Morearty

Reputation: 3348

Did you use the Rails 3 branch of will_paginate? It's here:

https://github.com/mislav/will_paginate/tree/rails3

Specify it in your Gemfile like this:

gem 'will_paginate', '~> 3.0.beta'

then install it like this:

bundle install

Upvotes: 2

Related Questions