RJS template sending JS that isn't executed?

I had a bunch of RJS stuff working in a project, then I copied that code
into a new project and now it doesn’t work correctly. I’m on Rails
1.1.6, latest Javascripts, developing and testing on Fedora Core 5,
using Firefox 1.5 (tested in Linux and WinXP). Here’s the deal:

Link in the initial view:
<%= link_to_remote “Bad”,
{ :url => { :action => “mark_address”, :id => raw_address.id,
:address_type => “raw”, :mark => “bad”, :good_id => good_address.id }
},
{ :class => “address_tool_button bad” } %>

Test RJS in controller:
def mark_address
render :update do |page|
page.alert(“RJS from controller”)
end
end

Test RJS in mark_address.rjs:
page.alert(“RJS from template”)

The RJS in the controller works, but when I remove the controller code
the same call doesn’t work in the template. Well, it sends JS to the
browser but then the alert doesn’t actually pop up. I’ve tried it with a
replace_html line in both place, too, same results. Firebug shows the
exact same JS and headers being returned either way, but it just doesn’t
do anything to the document when it’s sent by the template. The same
code in the old project still works with the same browser. I don’t get
it and I’ve run out of ideas.

Advice, anyone? Thanks.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs