problem using rjs, please help

Tim Rand
Thu, 23 Jul 2009 06:51:34 -0000

I was having fun with rails right up until ajax. And now want to burn the
whole thing down. Please explain what I am doing wrong here.
index.html.erb contains:

<%= javascript_include_tag ''prototype'' %>

...

I AM RJS
<%= link_to_remote("hello", :update => "rjs", :url
=> {:action =>
"hello_dude"})  %>


the controller file contains:
def hello_dude
render :text => Time. now
end

So far everything is works.  Now I try use let the rjs file :

change the controller file to
def hello _dude
respond_to do |format|
format.js
end

With the hello_dude.rjs file containing:
page.insert_html :bottom, :rjs, Time.now.to_s


Here is what shows up in my browser:

try { Element.insert("RJS", { bottom: "Wed Jul 22 23:28:17 -0700
2009" }); }
catch (e) { alert(''RJS error:\n\n'' + e.toString());
alert(''Element.insert(\"RJS\", { bottom: \"Wed Jul 22
23:28:17 -0700 2009\"
});''); throw e }
hello <http://localhost:80/orders?search=shoes#>


I don''t get it. Please help me get rid of this annoying error message.
Thanks,
Tim

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---