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/

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.