【发布时间】:2016-02-06 22:04:55
【问题描述】:
我正在我的控制器中执行多模型弹性搜索,但没有设法让结果与will_paginate gem 分页。
在我的控制器中,我有:
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>。
【问题讨论】:
标签: ruby-on-rails elasticsearch pagination will-paginate