Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page_entries_info not accept model object with Rails 4.1.8 #429

Open
ldonnet opened this issue Jan 6, 2015 · 1 comment
Open

page_entries_info not accept model object with Rails 4.1.8 #429

ldonnet opened this issue Jan 6, 2015 · 1 comment

Comments

@ldonnet
Copy link

ldonnet commented Jan 6, 2015

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

@AlexandrBasan
Copy link

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' %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants