Rails tutorial will_paginate raises undefined_method total_pages
-
29-10-2019 - |
Вопрос
Ive been stuck for a while now in the rails tutorial. Im in section 10.3, where we are supposed to add pagination. I have added the gem 'will-paginate' to my Gemfile, and this is the index view
<h1>All users</h1>
<%= will_paginate %>
<ul class="users">
<% @users.each do |user| %>
<li>
<%= gravatar_for user, :size => 30 %>
<%= link_to user.name, user %>
</li>
<% end %>
</ul>
<%= will_paginate %>
The server raises the following problem:
ActionView::Template::Error (undefined method `total_pages' for #<Array:0xa0283fc>):
1: <h1>All users</h1>
2: <%= will_paginate %>
3: <ul class="users">
4: <% @users.each do |user| %>
5: <li>
I have been trying to search for it.. but none of the solutions to apparently similar issues worked. Any ideas?
Нет правильного решения
Не связан с StackOverflow