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
對象。該物業遺失。我不知道爲什麼。
任何想法?