I''ve done the ''Googling'' for days now to find an example of using two dependent select statements on a form where the user selects the parent record value and the observe_field ''kicks in'' to create another select that shows parent.children offerings. Is there anyone I can pay to provide me with the simplest example? If so, please contact me by email. Hopeful thanks, David -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi David, On Sat, 2010-02-06 at 11:29 -0800, InventoryTrackers wrote:> I''ve done the ''Googling'' for days now to find an example of using two > dependent select statements on a form where the user selects the > parent record value and the observe_field ''kicks in'' to create another > select that shows parent.children offerings. > Is there anyone I can pay to provide me with the simplest example? If > so, please contact me by email.The general model, having rendered the form, is to pass the selected parameter back to a controller which then a) uses that value to query the database for the values to use for the second select and then b) uses rjs to render a partial containing the second select, passing the collection obtained in a) in via a local or via an instance variable. Which of these steps are you having trouble with? Post the (relevant snippets of) code you''ve got and we can help. Best regards, Bill -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Feb-07 17:33 UTC
Re: observe_field example of two related selects
InventoryTrackers wrote:> I''ve done the ''Googling'' for days now to find an example of using two > dependent select statements on a form where the user selects the > parent record value and the observe_field ''kicks in'' to create another > select that shows parent.children offerings. > Is there anyone I can pay to provide me with the simplest example? If > so, please contact me by email.Unfortunately, it''s best not to use observe_field. Rails'' JavaScript helpers mix JS into HTML, which is bad practice (Rails 3 will fix this). Just write the JavaScript yourself -- it''s quite simple -- and put it in an external file.> Hopeful thanks, > DavidBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.