How do I pass more than one parameter through :with in a field observer? Here is my code: < %= observe_field(''article_image_id'', :frequency => 0.25, :update => ''image_preview'', :url => { :action => :image_preview }, :with => "''id=''+value") %> I need to pass also another value. How should I modify the code? Thanks Stefano -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You''re just building up a string that represents the query string for the http request using javascript,so add ''&my_new_param=''+my_param_value On Jun 1, 6:04 pm, Stefano Bonomi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> How do I pass more than one parameter through :with in a field observer? > > Here is my code: > > < %= observe_field(’article_image_id’, > :frequency => 0.25, > :update => ‘image_preview’, > :url => { :action => :image_preview }, > :with => “‘id=’+value”) %> > > I need to pass also another value. How should I modify the code? > > Thanks > > Stefano > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''d like to add that you may need to encode the parameter :with => "''myparam=''+encodeURIComponent($F(''form_field_id'')) +''¶m2=''+encodeURIComponent($F(''form_field_id''))" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jun 2, 5:12 am, rubynuby <dear...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''d like to add that you may need to encode the parameter > > :with => "''myparam=''+encodeURIComponent($F(''form_field_id'')) > +''¶m2=''+encodeURIComponent($F(''form_field_id''))"You should indeed be doing that. There''s some other ways of doing this, I wrote about it over at http://www.spacevatican.org/2008/5/17/with-or-without-you-link_to_remote-s-mysterious-parameter Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 02 June 2008 09:02:15 Frederick Cheung wrote:> I wrote about [link_to_remote :with] over at >http://www.spacevatican.org/2008/5/17/with-or-without-you-link_to_remote-s-mysterious-parameter That''s the best treatment of the subject I''ve ever seen! Thanks, Sheldon. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIQ+EepGJX8XSgas0RAg49AJ97nRSPPAHCEUD56Hya8G6EmrBoIQCgkKtT F5hIUF1RdF2Cst30jyuQ/Jo=kmsd -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Many thanks guys! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---