Skip to content

Instantly share code, notes, and snippets.

@tetherit
Created September 21, 2012 18:15
Show Gist options
  • Save tetherit/3763041 to your computer and use it in GitHub Desktop.
Save tetherit/3763041 to your computer and use it in GitHub Desktop.
.zone_selection
= grouped_collection_select(:event, :zone_id, @locations, :zones, :name, :id, :name, {:selected => "50463aa79438a08e45000037"})
= params
# Generates the following HTML
<div class='zone_selection'>
<select id="event_zone_id" name="event[zone_id]"><optgroup label="Roman&#x27;s Home"><option value="50463aa79438a08e45000001">Garden Side</option>
<option value="50463aa79438a08e4500000a">Doorbell</option>
<option value="50463aa79438a08e45000037">Entrance (Front)</option>
<option value="50463aa79438a08e4500000e">Garden Wide</option>
<option value="5058d28f9438a0f14f000062">Test Zone</option></optgroup><optgroup label="Roman&#x27;s Car"><option value="505882249438a0f14f000039">Audi A4</option></optgroup></select>
</div>
# Why does the option with Entrance (Front) not have a selected=selected attribute?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment