所以我試圖用will_paginate-Rails3中和它不在這裏工作了是我在我的控制器:will_paginate gem是問題
def index
@posts = Post.paginate(:page => params[:page], :per_page => 2)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @posts }
end
end
的Gemfile:gem "will_paginate-rails3", '~> 3.0.pre'
帖子/ index.html.erb :<%= will_paginate @posts %>
NoMethodError: NoMethodError (undefined method `paginate' for #<Class:0x12c3438>):
app/controllers/posts_controller.rb:5:in `index'
Rendered C:/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.0ms)
Rendered C:/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.0ms)
Rendered C:/Ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (15.6ms)
捆綁安裝說,創業板是存在的:
有人知道我犯了什麼錯誤嗎?謝謝,
馬特
增加.all仍然有錯誤。安裝了一個軟件包只是爲了確保和重新開發,仍然沒有運氣 – Matt 2011-06-15 21:34:12
嗯,我似乎已經遇到過去。讓我看看我是否可以挖掘我的舊代碼。 – 2011-06-15 21:44:27
看來,這是一個已知的問題... https://github.com/radiant/radiant/issues/221 – 2011-06-15 21:47:58