I have a simple constant called "subjects" in my model Inquire.rb and I like to know if there is a simple way to use the position in the Ruby array rather than making a hash from it with ids or some more complicated array.
Can I do this?
i.e. instead of to_s as it currently does for the value in the select, I would want an integer indicating the position of the question in the array. 1-5 in this case.
Thanks
SUBJECTS = [ "I have a query about my booking",
"I can't find my confirmation email",
"I have feedback about a location",
"I have feedback about your website",
"Other enquiry" ]
<%= f.collection_select :subject, Inquire::SUBJECTS, :to_s, :titleize, {:prompt => true} %
>