【发布时间】:2013-07-25 18:36:37
【问题描述】:
这是我第一次尝试使用 will_paginate(我知道!我去哪儿了??)
titles_controller.erb
def index
@titles = Title.active.sorted.paginate(:page => params[:page])
end
index.html.erb
<% will_paginate @titles.each do |title| %>
错误:
undefined method `total_pages' for #<Enumerator:0x00000002bacaf0>
我做错了吗?提前致谢。
【问题讨论】:
标签: ruby-on-rails will-paginate