I would like to know if thereis a plugin or a tutorial at least on how to make a dynamic select form?
I am trying to select the car name using f.select and depending on what carname is selected in the next f.select will be displayed only models that belongs_to the car name.
I’ve tried the Railscasts solution, but it seems that it’s for older version of rails or I did something wrong.
Thanks.
I use rails 3.0 and the railscasts I tried is http://railscasts.com/episodes/88-dynamic-select-menus
There is no automatic way (if I understand correctly – when the user chooses carname in some select box, the options in another select box must change accordingly). I will assume carmodel is a select box but if it’s a textbox you can still use the same solution. You basically have 2 options:
The Ajax solution will be easier because you need less Javascript logic.
To see how to add options to select box with jQuery look at this question: What is the best way to add options to a select from an array with jQuery?