[Rails] Re: link_to_remote where the url contain a javascript variable

Mark Reginald James
2006-01-15T03:22:47Z

Didier Prophete wrote:
> Ok, so I am basically trying to use ''link_to_remote'' and
pass the value
> of a javascript variable as an argument. Something like that:
>
>    link_to_remote "my_link",
>                           :update => ''my_div'',
>                           :url => { :action => "my_action",
:var =>
> ''my_var'' }
>
> Basically, ''my_var'' is a javascript variable which I want
to pass to
> ''my_action''.

Add a

       :with => ''my_var''

option to your link_to_remote call and retrieve it in your
controller using request.raw_post

--
We develop, watch us RoR, in numbers too big to ignore.