Skip to content

Instantly share code, notes, and snippets.

@lcosta
Forked from rguggemos/Kaminari ajax pager
Created January 12, 2013 23:55
Show Gist options
  • Save lcosta/4521114 to your computer and use it in GitHub Desktop.
Save lcosta/4521114 to your computer and use it in GitHub Desktop.
If you switch to kaminari,
http://railscasts.com/episodes/254-pagination-with-kaminari
...the lines added to application.js become redundant when you implement the pager like in this demo project:
https://github.com/amatsuda/kaminari_example/tree/ajax
in index.html:
<%= paginate @users, :remote => true %>
in index.js.rb:
$('#users').html('<%= escape_javascript render(@users) %>');
$('#paginator').html('<%= escape_javascript(paginate(@users, :remote => true).to_s) %>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment