I just upgraded an application from Rails 2.3 to Rails 3.0. This application make extensive use of Ajax.
Since the upgrade, each
respond_to do |format|
format.js
end
Responds with a content type of text/html instead of text/javascript (as viewed in Firebug). The XHR request specifies Accept="text/javascript". The result is that Prototype refuse to eval the response, so no more magic on my pages…
For precision, I decided to include the legacy RailsPrototypeHelpers, the full UJS app will be the next application.
For information, I tried to put the js in js.rjs files: content-type is still 'text/html'
I tried to inline js and force with render :update, :content_type => 'text/javascript': no luck, still answer with 'text/html' content_type.
Any suggestion is welcome.
Thank you.
text/javascripton first post request, buttext/htmlon the second one, which gives me a 406. Using Rails 3.2.3