I am trying to implement the solution as outlined in this post but can't get it to work.
application.js
$(document).ready(function(){
$.ajaxSetup({
beforeSend:function(){
$('#loading').show();
},
complete:function(){
$('#loading').hide();
}
});
});
application.html.erb
<div id="loading" style="display:none;"><img src="/img/ajax-loader-circle.gif" ></br></br>Please wait...</div>
From my form, I added :remote => true
and I could tell that an AJAX call was made looking at Rails logs. However, beforeSend show
never got triggered. Thoughts?
` – Rafay Aug 09 '11 at 23:01