Skip to content

Instantly share code, notes, and snippets.

@th1agoalmeida
Created October 22, 2010 02:15
Show Gist options
  • Save th1agoalmeida/639792 to your computer and use it in GitHub Desktop.
Save th1agoalmeida/639792 to your computer and use it in GitHub Desktop.
class user
GENDERS = {'-'=>'0','user.gender.female'=>'1','user.gender.male'=>'2'}
<%= select("user", "gender", User::GENDERS) %>
<select id="user_gender" name="user[gender]">
<option value="0" selected="selected">-</option>
<option value="1">user.gender.female</option>
<option value="2">user.gender.male</option>
</select>
is there a way I can translate this array of strings directly?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment