RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: tancoder
thanks @Bardwin for sharing! This works great but I want to hide the pagination on every page vs just the very last page and simply have the "Show more products" button on each page. Any ideas on how to accomplish that?
Currently my index.js.erb is below
$('#items').append('<%= j render('items') %>'); <% if @items.next_page %> $('.pagination').replaceWith('<%= j will_paginate(@items) %>'); <% else %> $('#append_and_paginate').remove(); <% end %> <% sleep 1 %>
Thanks again.
thanks @Bardwin for sharing! This works great but I want to hide the pagination on every page vs just the very last page and simply have the "Show more products" button on each page. Any ideas on how to accomplish that?
Currently my index.js.erb is below
$('#items').append('<%= j render('items') %>');
<% if @items.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@items) %>');
<% else %>
$('#append_and_paginate').remove();
<% end %>
<% sleep 1 %>
Thanks again.