Forum: Ruby on Rails JavaScript variable into <%= %>-area

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.
rickthemick (Guest)
on 2005-12-09 17:57
Hi!
My problem is simple (to understand) but I dont know how to solve it.
Below I want to put "js_param" where the "????" are!

Anyone know how to do this?

index.rhtml:
----------------------------
<html>
...
function js_udt(js_param)
{
  setTimeout("<%= remote_function(:update => 'dummy', :url => { :action
=>
  'update_fcn', :param => ???? }) %>", 0);
}
...
</html>
----------------------------

Thanx!
mrj (Guest)
on 2005-12-10 00:55
(Received via mailing list)
rickthemick wrote:

>   setTimeout("<%= remote_function(:update => 'dummy', :url => { :action
> =>
>   'update_fcn', :param => ???? }) %>", 0);
> }
> ...
> </html>

setTimeout( "new Ajax.Updater('dummy', '<%= url_for(:action =>
'update_fcn') -%>?param=" + escape(js_param) + "', {asynchronous:true,
evalScripts:true})", 0);

--
We develop, watch us RoR, in numbers too big to ignore.
This topic is locked and can not be replied to.