Topic: stuck on an rjs thing

hey all,
I'm trying to replace the content of a span with "update ok" text.
That is my view :

<%= link_to_remote 'update', :update => 'updatespan',
     :url => { :action => 'edit',:id=>r.id.to_s } %> <span
id="mytext">some text</span>

what I try to do:
 render :update do |page|
page.replace_html  @spanid,
                "update ok"
page.visual_effect :highlight, @spanid
end

but I get the following error:
try { } catch (e) { alert('RJS error:\n\n' + e.toString()); alert(''); throw e }

thanx in advance

Pat

Re: stuck on an rjs thing

What is the @spanid variable set to?

Also, you shouldn't supply an :update parameter to the link_to_remote when using RJS:

<%= link_to_remote 'update', :url => { :action => 'edit',:id=>r.id.to_s } %>

Railscasts - Free Ruby on Rails Screencasts

Re: stuck on an rjs thing

 @spanid=params[:spanid]

I removed the :update=> but now nothing happens

Re: stuck on an rjs thing

I don't see any "spanid" parameter set when generating the URL, so I don't think it will evaluate to anything. Try entering the span name manually.

render :update do |page|
  page.replace_html :mytext, "update ok"
  page.visual_effect :highlight, :mytext
end

Railscasts - Free Ruby on Rails Screencasts