Skip to content

Instantly share code, notes, and snippets.

@jeffjohnson9046
Created October 22, 2013 00:02
Show Gist options
  • Save jeffjohnson9046/7093046 to your computer and use it in GitHub Desktop.
Save jeffjohnson9046/7093046 to your computer and use it in GitHub Desktop.
How to "ajaxify" the control that will_paginate generates.
// "Ajaxify" the will_paginate control.
$(".pagination a").live("click", function() {
$(".pagination").html("Loading...");
$.getScript(this.href);
return false;
});
// For reference, here's what the html in the Rails view looks like:
// <div class="pagination pagination-centered">
// <%= will_paginate %>
// </div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment