I am very new to jquery and trying to figure out if I am able to add a spinner to use in conjunction with Kaminari
I have pagination of 200 Contacts with code below.
<%= paginate contacts, remote: true, params: { :controller => "contacts", :action => "index" } %>`
I can see that I need to use some code like this:
var $loading = $('#loadingDiv').hide();
$(document)
.ajaxStart(function () {
$loading.show();
})
.ajaxStop(function () {
$loading.hide();
});
my question is where do put this? - at the bottom of the the page - in a js.erb - somewhere else?
what do i need to do to get it to trigger with Kaminari?
many thanks.