【发布时间】:2011-09-15 09:52:04
【问题描述】:
我正在为我的 rails 应用程序使用 will_paginate "2.3.15"
在我的units_controller.rb中
def index
@units = Unit.paginate(:all ,:page => params[:page], :order => 'created_at DESC')
end
in my views(index)
<%= will_paginate(@units)%>
but it gives error
undefined method `total_pages' for #<ActiveRecord::Relation:0xb523dc>
我的 Rails 版本 3.0.0 和 ruby 版本 1.8.7
请帮忙
【问题讨论】:
标签: ruby-on-rails will-paginate