Skip to content

Instantly share code, notes, and snippets.

@rguggemos
Created March 18, 2011 17:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rguggemos/876500 to your computer and use it in GitHub Desktop.
Save rguggemos/876500 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.rb:
$('#users').html('<%= escape_javascript render(@users) %>');
$('#paginator').html('<%= escape_javascript(paginate(@users, :remote => true).to_s) %>');
@aristotelesbr
Copy link

Tks afeter 5 year!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment