I am new to RoR so I'm missing something very basic here, but I can't figure it out. I'm using Kaminari gem for pagination in RoR application by calling in controller:
users_controller.rb:
def index
@users = User.order('created_at DESC').page(params[:page])
end
In my view I have:
users/index.html.erb:
<%= paginate @users %>
<%= render @users %>
Finally, my user partial is:
users/_user.html.erb
<% @users.each do |u| %>
(data output like <%= u.login %> and so on)
<%= end %>
So it is as simple as it can be and similar to Kaminari usage example. However, I receive proper table with specified number of rows but that table is rendered n times where n is number of paginates_per option. Pagination ifself works fine, but I can't debug that problem, what I'm doing wrong?
I have used will_paginate gem before Kaminari and it worked fine out of the box, so my app is not completely broken somewhere deeper (if it could be in such simple case).
According to the logs everything is rendered once so the @users object contains multiplied data.