Skip to content

Instantly share code, notes, and snippets.

@lcpriest
Created October 15, 2013 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcpriest/6999049 to your computer and use it in GitHub Desktop.
Save lcpriest/6999049 to your computer and use it in GitHub Desktop.
Simple implementation of autoscroll with will_paginate
$('#collection').append("<%= j render partial: 'partial', collection: @collection %>");
<% if @collection.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@collection) %>');
<% else %>
$('.pagination').remove();
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment