remote_function with local javascript variable

Hi list,

I'm trying to get a local javascript variable submitted with remote_function:

<script language="javascript">

var local_variable = "I do really important stuff"; <%= remote_function :url => {:action => "boo", :id=> 1}, :submit => 'local_variable' %>


The above snippet seems to be close but generates new Ajax.Updater('foo', '/temp/boo/1', {asynchronous:true, evalScripts:true, parameters:Form.serialize('local_variable')})

but I don't want the form to be serialized (there is no form!) I want the value of 'local_variable' to be serialized and submitted. Any ideas?

Thanks, Dan

Maybe remote_function with a :with parameter will help?


thanks - looks like this might do the trick:

remote_function :url => {:action => "boo", :id=> 1},                                    :with => "'variable='+local_variable"

It looks like this appends &variable=blah to the URL which is enough for me, but it would be interesting to see if it could serialise and post variable values as well - maybe some other time!