这是使用will_paginate(我知道我在哪里了?!)我第一次尝试轨道4 - 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>
WTF am I d错了吗?提前致谢。
谢谢 - 我确实读过文档,但认为will_paginate调用位于顶部。现在明白了。 –
嘿,对不起,如果这听起来粗糙,这不是我的意图;) – Lucas