I have a select table that is generated using
view :
<select id = "car_type", name="car_type">
<%= options_from_collection_for_select @cartype, 'id', 'name' %>
<select>
and in controller I have this
@cartype = Cartype.find(:all)
I need to get the current selection value, so I can generate a second select table based on the first option selection. I am aware that this can be done with observe_field, however, there is some problems with observe_field, so first I decided to use parameter passing.
Would appreciate for any hints
can anyone point out, how can I get the current selection value and pass the value?
As you can see in the Rails documentation for options_from_collection_for_select the last parameter is the selected value and should be an interger. E.g.