Skip to content

Instantly share code, notes, and snippets.

View ericcf's full-sized avatar

Eric Carty-Fickes ericcf

  • Northwestern University
  • Chicago, IL
View GitHub Profile
@ericcf
ericcf / index.js.erb
Created December 19, 2011 14:52 — forked from ryanb/index.js.erb
Infinite scrolling solution covered in revised episode #114: http://railscasts.com/episodes/114-endless-page-revised
$('#products').append('<%= j render(@products) %>');
<% if @products.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@products) %>');
<% else %>
$('.pagination').remove();
<% end %>