0
我在我的控制器中執行多模型彈性搜索,並沒有設法得到結果與will_paginate
寶石分頁。分頁爲MultiModel elasticsearch
在我的控制,我有:
def index
@people = Elasticsearch::Model.search('*', [Authors, Editors])
end
然後在我的觀點,我有:
<table>
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
<% @people.each do |person| %>
<tr>
<td><%= person.name %></td>
</tr>
<% end %>
</tbody>
</table>
<%= will_paginate @people, renderer: BootstrapPagination::Rails %>
是不斷得到主要錯誤是undefined method 'total_pages' for #<Array:0x007fd8b0e32660>
。
使用雷... will_paginate是過時 –