Kaminari Ajax paginate doesn't work

690 views Asked by At

I have below view and controller. Though remote: true is mentioned, kaminari calls my method using http(using page refresh). Is there anything i am missing to make my kaminari links ajaxable.

In VIEWS:

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

In Controller:

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

I will be responding to ajax in my controller, but first it doesn't even make an ajax call.

1

There are 1 answers

2
smathy On BEST ANSWER

This is usually because you don't have jquery_ujs loaded, check your app/assets/javascripts/application.js file, it should have these two lines (at least):

//= require jquery
//= require jquery_ujs