will_paginate
will_paginate copied to clipboard
page_entries_info not accept model object with Rails 4.1.8
Hi,
I use your great gem in my rails application and migrate from rails 3.1.13 to Rails 4.1.8 and encounter perhaps a bug.
I have a view which display companies :
<div id="companies">
<%= render partial: "companies", object: @companies %>
</div>
and call a partial :
<div class="page_info">
<span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info( @companies ) %>
</div>
<div class="companies paginated_content">
<%= paginated_content(@companies) %>
</div>
<div class="pagination">
<%= will_paginate @companies, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %>
</div>
And my code fails on "page_entries_info( @companies )" : ActionView::Template::Error : wrong number of arguments (1 for 0).
But when I do this trick "page_entries_info( @companies.to_a )" it works :
<div class="page_info">
<span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info( @companies.to_a ) %>
</div>
<div class="companies paginated_content">
<%= paginated_content(@companies) %>
</div>
<div class="pagination">
<%= will_paginate @companies, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %>
</div>
Do i use a bad syntax or make a mistake somewhere?
Best Regards Luc Donnet
Same problem for me after update Rails but for object with one page not more, working with .to_a Example: <%= page_entries_info @users.to_a, :model => 'users' %>