I\'m trying to replace the content of a div after clicking on a link using Rails 3, remote_link :remote => true
and jQuery.
So far, I\'ve been able to ge
I was also getting odd parsererror
s even though my remote links were correctly pointing to actions with :format => :js
and my controller actions were correctly using respond_to
to serve up JSON objects like:
respond_to do |format|
format.js do
render :json => {:something => "OK"}
end
end
The solution ended up being just dropping this line into my application.js
:
$.ajaxSettings.dataType = "json";
By default, it appeared that jQuery was trying to evaluate all responses as "script"
, which I guess means it was trying to execute it as code—? Dropping this line in once fixed the issue globally.