Render :update problem with IE 9

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) %>

<%= render :partial => "odd" %>

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

Hi,

It turned out that the 1.7_rc2 version of prototype.js, which is
delivered with rails 3.0.9, had some issues with render :update. After
using the latest stable version of prototype.js (1.7.0) the problem
disappeared.

Cheers,
Zsolt