Ian Irving
2010-Jun-16 14:11 UTC
Building a Cascading Drop Down Selection List for Ruby on Rails with jQuery Ajax
Cascading Drop Down Selection Lists are when the value of a second drop down are filtered based on the values a first field (usually a drop down, but could be a radio box, check box or even text) Select a Country and then State or Province; or Select a Car Manufacture and then a Car Model. This time of feature is has also been called Related Drop Down fields or Dependant Drop Down lists or Dynamic Drop Downs or Dependent Drop Downs. I''ve posted code and discussion over at http://www.falsepositives.com/index.php/2010/05/28/building-a-casscading-drop-down-selection-list-for-ruby-on-rails-with-jquery-ajax/ The code is built and Tested with Ruby on Rails 2.3.5 and jQuery 1.4.2 Hope you find this useful. feedback welcome. Ian Irving Toronto, Canada Code and Culture : http://www.FalsePositives.com Building the People and Data Driven Web : http://www.ConnectedThinking.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Me
2010-Jun-16 15:19 UTC
Re: Building a Cascading Drop Down Selection List for Ruby on Rails with jQuery Ajax
Easiest would be to make the select a partial and update the partial based on the object sent to the query. You make an ajax call when an item is selected, query the db, replace the select you want to update with the partial with the items scoped for the parent object. On Jun 16, 9:11 am, Ian Irving <i...-RIa5mop6L5pcPe/4nw4AONBPR1lH4CV8@public.gmane.org> wrote:> Cascading Drop Down Selection Lists are when the value of a second > drop down are filtered based on the values a first field (usually a > drop down, but could be a radio box, check box or even text) > > Select a Country and then State or Province; or Select a Car > Manufacture and then a Car Model. > > This time of feature is has also been called Related Drop Down fields > or Dependant Drop Down lists or Dynamic Drop Downs or Dependent Drop > Downs. > > I''ve posted code and discussion over athttp://www.falsepositives.com/index.php/2010/05/28/building-a-casscad... > > The code is built and Tested with Ruby on Rails 2.3.5 and jQuery > 1.4.2 > > Hope you find this useful. feedback welcome. > > Ian Irving > Toronto, Canada > Code and Culture :http://www.FalsePositives.com > Building the People and Data Driven Web :http://www.ConnectedThinking.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.