这是我第一次尝试使用 will_paginate (我知道!我去过哪里??)
标题控制器.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>
WTF我做错了吗?提前致谢。