search for: statuses2

Displaying 1 result from an estimated 1 matches for "statuses2".

Did you mean: statuses
2007 Apr 23
1
Using Array or Hash with Form Select and Elsewhere
...39;,''open''],[''Closed'',''closed'']] That works directly in a form using "select :status, Thing::STATUSES1". But I don''t know how to lookup the capitalized version in the array given the lowercase status value. If I use a hash: STATUSES2={''open''=>''Open'',''closed''=>''Closed''} It is easy to display the formatted value in pages using: <%= Thing::STATUSES2[thing.status] %> I tried to use this hash in the form select, but the value/text is backwards: it...