I love JQuery! I did a short 10-15 minute presentation at the last Dallas.rb to let others in on the joys of using JQuery.
But one thing that doesn’t work right when using JQuery with Rails applications is the JQuery AJAX features and Rails respond_to. It turns out the Rails it looking for a specific request header, but JQuery sends something different one.
It is easily solved with this at the top of your application.js file:
$.ajaxSetup({
beforeSend: function(xhr) {xhr.setRequestHeader("Accept", "text/javascript");}
});

