1
我使用下面的代码Will_Paginate ::收集缺少total_entries财产
@paginatedResults = WillPaginate::Collection.new(1, 5)
@paginatedResults.replace @results[@paginatedResults.offset,
@paginatedResults.per_page]
创建Will_Paginate::Collection
对象,但是当我尝试呈现使用
<%= will_paginate @paginatedResults %>
我得到一个异常分页
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.>
我已将它追溯到total_entries
属性o Will_Paginate::Collections
对象。该物业遗失。我不知道为什么。
任何想法?