deiga
1/26/2013 - 5:00 PM

Kaminari ajax pager

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)}");