Skip to content

Instantly share code, notes, and snippets.

@renevall
Created June 25, 2013 23:01
Show Gist options
  • Save renevall/5863224 to your computer and use it in GitHub Desktop.
Save renevall/5863224 to your computer and use it in GitHub Desktop.
Making Kaminari Pagination work as ajax request.
jQuery ->
$(document).on "click",'.pagination a[data-remote=true]', (e) ->
history.pushState {}, '', $(@).attr('href')
$("#reviews").html('<%= escape_javascript render("review") %>')
$("#paginator").html('<%= escape_javascript(paginate(@reviews, :remote => true).to_s) %>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment