How to use remote_function :with option?

I’d like to send some simple info to my controller using the :with
option for remote_function

remote_function :url => url_for(:action => ‘my_action’), :with =>
???

But I don’t know anything about JavaScript. How can I use the :with
option to send a simple parameter to the controller? I’ve tried a few
things, but I haven’t had any luck.

This should be really, really simple. Can someone tell me what to put
in the :with => ?

Thanks,
Steve

I figured it out –

I placed a dummy form in my template

then I used the :with option like this

remote_function :url => url_for(), :with => ‘Form.serialize($(“dummy”))’

And “foo”=>“bar” came across in the @params.

Stephen How wrote:

And “foo”=>“bar” came across in the @params.

See also this blog post for more :with info
http://codefluency.com/articles/2006/06/02/rails-views-using-the-with-option/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs