I figured it out -- I placed a dummy form in my template <form id="dummy"><input type="hidden" name="foo" value="bar" /></form> 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. -- Posted via http://www.ruby-forum.com/.
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 -- Posted via http://www.ruby-forum.com/.
Stephen How wrote:> I figured it out -- > > I placed a dummy form in my template > > <form id="dummy"><input type="hidden" name="foo" value="bar" /></form> > > 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. > >See also this blog post for more :with info http://codefluency.com/articles/2006/06/02/rails-views-using-the-with-option/