问题
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:
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
来源:https://stackoverflow.com/questions/30988434/kaminari-ajax-paginate-doesnt-work