Skip to content

Instantly share code, notes, and snippets.

@deiga
Forked from rguggemos/Kaminari ajax pager
Created January 26, 2013 17:00
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 deiga/4643271 to your computer and use it in GitHub Desktop.
Save deiga/4643271 to your computer and use it in GitHub Desktop.
Kaminari ajax pager
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.haml:
$('#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