JQUERY ON RAILS3 AUTO SELECT

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.