Forum: Ruby on Rails JavaScript Prompt and link_to_remote

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.
1f8a2831a8b45f62eee765c96c67747a?d=identicon&s=25 Nickolay Kolev (nmk)
on 2006-05-05 16:05
(Received via mailing list)
Hi all,

I would like to get one of the parameters for a link_to_remote with
JavaScript prompt. So far I have this:

link_to_remote(image_tag("/images/interface/add.png"),
   :before => "$name = prompt('Name?')",
   :url => { :action => 'add_child', :id => node, :name => XXX },
   :update => "node_list_#{node.id}",
   :position => 'top',
   :complete => visual_effect(:highlight, "node_list_#{node.id}")
   )

I get prompted for the name. How do I add it to the parameter list,
i.e. what do I have to put in the place of XXX on the third line above?

Many thanks in advance,
Nickolay
This topic is locked and can not be replied to.