Forum: Ruby on Rails rjs and Ajax.Updater

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
908162e45bae519efc1dc8d567db4077?d=identicon&s=25 Thomas Johnson (tomfmason)
on 2007-05-29 17:10
I have been searching for a while now have not be able to find any type
of list of the prototype and effects functions available to rjs. Most of
what I have done has either come from simple examples found here and
there or guess work(mostly the latter). Here is the problem that I am
having


[code]
<% proj_div = "proj_div#{@project.id}" %>
<% proj_url = "/project/show_status/#{@project.id}" %>
  <li><%= link_to_function("Edit", nil, :id => "edit_ref#{@project.id}")
do |page|
          page.Ajax.Updater(proj_div, proj_url, {:asynchronous => true,
:evalScripts => true, :onComplete => "alert('it worked!');"})
    end
       %>
  </li>
[/code]

firefox error
[quote]
Error: this.initialize has no properties
Source File: http://localhost:3001/javascripts/prototype.js?1178489268
Line: 23
[/quote]

selection source
[code]
<li><a href="#" id="edit_ref3484"
onclick="Ajax.Updater(&quot;proj_div3484&quot;,
&quot;/project/show_status/3484&quot;, {evalScripts: true, asynchronous:
true, onComplete: &quot;alert('it worked!');&quot;});; return
false;">Edit</a>
[/code]

I am not really sure what I am doing wrong. This is all guess work so I
may be way off. I know that I could just use link_to_remote but I plan
on doing much more there but it all depends on being able to use the
Ajax.Updater function. Any suggestions would be greatly appreciated
908162e45bae519efc1dc8d567db4077?d=identicon&s=25 Thomas Johnson (tomfmason)
on 2007-05-29 17:33
I have traced the source of the problem down to the fact that the quotes
are converted to &quot;'s. Any suggestions as to how I can prevent that?
E78c66aae4fc2eedd5867d0b13594cdb?d=identicon&s=25 TheIdeaMan (Guest)
on 2007-05-31 16:13
(Received via mailing list)
You need to put "new" in front of your Ajax.Updater line. If you add
that, you should get the expected result.

Hope that helps.
This topic is locked and can not be replied to.