In earlier post of mine, we have seen, how to implement “Auto Select”, with the help of Prototype and Rails.

Now, that Rails-3 has been released, lot of changes are already made. In-built support for Prototype has been removed. Still if you wish to use prototype, all you need is to install its gem.

Here, I am covering the same example:

– Select ‘Country’ from the first drop down.
– Second drop down will populate the list of ‘States’. If you select any state:
– Third drop down will populate the list of ‘Countries’.

All I am using here is Rails-3, Rails-3 UJS, and Jquery.

I would also like to thank Ryan Bates, for the railscasts he provided to implement this using unobtrusive javascript.

Please download the application with the link provided and let me know your feedback.

System Requirements/Features Covered in this application.
– Ruby 1.8.7
– Rails 3.0.0 or higher
– Country -> State -> City Drop down
– Ajax Search

Steps to run the application:
– Create a schema. Change the database.yml accordingly.
– Run rake db:migrate
– Start the server.
– Please do read the README file.