Topic: Choose order Rails records, or show “ ALL ” in first - (Form)
I'm searching for a method to choose the first record of a grouped_collection_select, or to show " ALL " in the first choice.
<%= f.collection_select :marque_id, Marque.all, :id, :name_upper, :include_blank => 'ALL', :prompt => 'Mark' %> <%= f.grouped_collection_select :modele_id, Marque.all, :modeles, :name_upper, :id, :name_upper, :prompt => 'Model', :include_blank => 'ALL' %>
The " :include_blank => 'ALL' " work fine for the collection_select, but not for the grouped_collection_select.
For the grouped_collection_select, it only show "ALL" at the first place, but not in each subcategorie.
e.g : 'ALL' - 147 - 156 - Golf - Passat.
And I want =>(Alfa Romeo) 'ALL' - 147 - 156 / (Volkswagen) 'ALL' - Golf - Passat... etc
I use the Dynamic Select Menus from RailsCasts (episode #88)
I tried to put a blank record in the database, or to put " ALL " in the database with a lot of symbol like : " # ALL # " ... Didn't work with number ( 147, 156, 159 [...], # ALL #,...)
Thanks a lot for your help!
Last edited by dl33ter (2012-06-10 19:26:40)