2011-02-04 73 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

回答