Hi,
I have a legacy web site based on ruby on rails 3.0.9 which works just
fine
with Firefox, chrome and IE 8, but I receive an HTTP 406 error every
time
when I check the web site with Internet Explorer 9. I narrowed down the
problem to the respond_to + format.js + render :update trio, but I did
not
manage to solve the problem until now.
I created a small example for reproduction:
The action from the controller:
def change
if params[:kind]
respond_to do |format|
format.js do
render :update do |page|
# originally we have a much more complicated logic here
# …
page.replace_html ‘list_of_numbers’, :partial =>
params[:kind]
# we even have this:
# page << “changePrefix();”
end
end
end
end
end
The view:
<%= link_to(“odd”, url_for(:controller => “main”, :action => “change”,
:kind => “odd”), :remote => true) %>
<%= link_to(“even”, url_for(:controller => “main”, :action => “change”,
:kind => “even”), :remote => true) %>
On the server side I see this:
Started GET “/change?kind=odd” for 10.0.8.9 at Wed Jan 04 11:10:59 +0100
2012 Processing by MainController#change as HTML Parameters:
{“kind”=>“odd”} Completed 406 Not Acceptable in 0ms
And the IE 9 says quite the same.
Any ideas why this doesn’t work with IE9?
Thank you in advance!
Sincerely,
Zsolt
–