3

So after ajaxifying the Kaminari pagination links, though the pagination works, the url doesn't update with respective page number, pgsize anymore. It works fine without remote: true option. Below are the details, am i missing anything ?

My VIEW:

    <div id="paginator">
      <%= paginate @user, params: {id: nil, pgsz: 20}, :remote => true %>
    </div>

MY Controller: Show method

  @user = Kaminari.paginate_array(@properties, total_count: @search_result.total_count).page(params[:page]).per(params[:pgsz] ||= 20)

In show.js.erb

$('#list').html("<%= escape_javascript(render 'search_result') %>");
$('#paginator').html(" <%= escape_javascript(paginate @user, params: {id: nil, pgsz: 20}, :remote => true) %>");
Rahul Dess
  • 2,397
  • 2
  • 21
  • 42
  • I think you need to use html5 history api for this. But thanks, I solved one of my problem with your question – Anwar Sep 09 '17 at 08:12
  • This might help https://stackoverflow.com/questions/17298104/rails-3-update-url-params-with-ajax-request – Anwar Sep 09 '17 at 08:12

0 Answers0