2011-02-04 71 views
2

的问题后,是我不断收到与我的will_paginate问题升级到Rails 3

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

下面的代码片段,我包括在固定我的问题的任何帮助。我目前正在使用will_paginate-rails3。

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

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

难道有人请指点我正确的方向吗?

+0

你有中列出的`will_paginate`宝石你的Gemfile?你有没有运行`bundle`命令? – raidfive 2011-02-04 03:24:25

+0

您是否也在模型中包含代码? – corroded 2011-02-04 03:25:57

回答