rjs not executing?

sayoyo
Wed, 24 Jan 2007 16:52:05 -0000

Hi,

I''m trying to execute a .rjs, but instead of executing the javascript
code, the javascript code is shown on the html. Does any one know why?

thanks you very much

Sayoyo
----------------------------------------------------------------------
example code:

on main.rhtml, I have:
<%= link_to_remote(''add'',
:url=>{:action=>''openAdd''},
:update=>''addZone'')-%>


on MainController.rb I have
def openAdd
end

on openAdd.rjs, I have
page.replace_html("addZone", :partial=>"openAdd")

on _openAdd.rhtml, I have
"add opened"

after click on "add" on the main.rhtml i got:
try { Element.update("addControlZone", "add opened\n"); }
catch (e) {
alert(''RJS error:\n\n'' + e.toString());
alert(''Element.update(\"addControlZone\",
\"toto\n\");''); throw e }

--
Posted via http://www.ruby-forum.com/.