0

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.

Rahul Dess
  • 2,397
  • 2
  • 21
  • 42

1 Answers1

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
smathy
  • 26,283
  • 5
  • 48
  • 68
  • u just saved my day bro !! thanks much ..is this documented anywhere that i missed ? – Rahul Dess Jun 22 '15 at 19:56
  • Probably not because it's the default Rails setup (ie. you have to remove those lines after creating a Rails app). There's probably a mention of it in the docs for the `:remote` option for `form_for` or `link_to` or something. – smathy Jun 22 '15 at 20:27