Ruby-on-rails – Dynamic select menu / cascading drop down in Rails

drop-down-menurubyruby-on-rails

Could someone suggest a guide/tutorial for implementing a dynamic select menu / cascading drop down in Rails using best practices? Or possibly recent Stackoverflow questions around the same topic. Possibly I'm searching the wrong terms.

I've taken a look at this railscast: #88 Dynamic Select Menus (revised) but am not convinced using a csv file to store the options is the best way to go about this.

Everything else that I've found regarding dropdowns seems incomplete or outdated.

Best Answer

Alternatively you might be interested in this RESTful Rails 4 solution: Dynamic select boxes with Rails 4.

Basically, the select boxes are populated from the model, the controller adds an action to pick the coherent subset of data, and the view is refreshed through an AJAX request.