I posted about this at ruby-forum but haven't gotten any answers. But the subject line pretty much sums it up. Here's the souce code in question:
<%= link_to_remote 'Foobar',
{:url => {:action => 'new'},
:update => 'contact',
:complete => "alert('aaaa')"},
:id => "new_tab", :class => 'tab'
%>
<%= link_to_remote 'Foobar',
{:url => {:action => 'new'},
:update => 'contact',
:complete => update_page do |page|
page.alert('aaaa')
end },
:id => "new_tab", :class => 'tab'
%>
They should yield the same thing, but in the second example, the onComplete callback ends up reading:
alert("aaaa")
I did quite a bit of digging in the source code, and the only place I could find where the escaping might be happening is in the url_for method. However, these callbacks should never be passed to url_for, so I am stumped.
I would really appreciate it if someone more familiar with the source code could fix this or at least provide a reasonable workaround.
BTW, I am using Rails v1.1.2, which does not appear in the dropdown.
Thanks much.