For some reason Kaminari is not limiting child objects on the parent show view.
Can see the pagination links but the collection does not get limited.
What am I doing wrong?
View -
<% if @handbag.microposts.any? %>
<h3>Posts (<%= @handbag.microposts.count %>)</h3>
<div class="row">
<div class="col-md-8">
<ol class="microposts">
<% @handbag.microposts.each do |micropost| %>
<li id="micropost-<%= micropost.id %>">
<span class="user"><%= micropost.user.email %></span>
<span class="content"><%= micropost.content %></span>
<%= image_tag micropost.picture.url if micropost.picture? %>
<span class="timestamp">
Added <%= time_ago_in_words(micropost.created_at) %> ago.
</span>
</li>
<% end %>
</ol>
<%= paginate @microposts %>
Controller -
def show
@handbag = Spree::Handbag.find(params[:id])
@microposts = @handbag.microposts.page(params[:page] || 1).per(10)
end
Thanks for any help.