I’m trying to populate a formtastic select menu using an Array.
model
PAYMENT_METHODS = %w[creditcard check money-order cash western-union]
views
<%= f.input :payment_methods, :as=>:select, :collection => User::PAYMENT_METHODS%>
It works but, this is how it appear now.
<select>
<option value="creditcard">creditcard</option>
<option value="western-union">western-union</option>
</select>
Instead I want it to look like:
<select>
<option value="creditcard">Credit Card</option>
<option value="western-union">Western Union</option>
</select>
How can I get this to work?
I wasn’t able to test it, but I think you can do it this way.
From the Programming Ruby docs.
Updated:
After reading back through the select examples on the formtastic Github page, I believe you can do this. As before, it is untested.