problem using rjs, please help

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

I don’t get it. Please help me get rid of this annoying error message.

Thanks,

Tim

Hi   change

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

   to

<%= link_to_remote("hello", :url => {:action =>> "hello_dude"}) %>

Sijo

sijo is right , when you use :update that try to update that fragment and send the response to that fragment

before the calling of rjs the response already send to that fragment

Thank you. It works. I will put the gasoline back in the truck...for now. Tim