I need to create a select box from the values available in a Hash.
For instance, I have a \'thing\' and the \'thing\' has a variety of status fields:
1 =
Hash.each |a|
returns an array of the form a = [key, value]
, so for the hash @status_fields
you can write:
<%= collection_select('thing', 'status', @status_fields, :first, :last) %>
Alternatively, if you'd like the key to show up in the select list and the value point to the select list value, then:
<%= collection_select('thing', 'status', @status_fields, :last, :first) %>