how to change the value to a name depending on case
- by ZeroSoul13
i've created a select button with 3 option
<%= f.label :prioridad %><br/>
<%= f.select :prioridad, options_for_select([['Alta', 1], ['Medio', 2], ['Baja', 3]]) %>
The value gets inserted to the DataBase but when i display it i see the number op the option selected (which is correct).
What i would like to know is how i can change that so on the index the user can see the name and not the value:
def convertidor
case llamada.prioridad
when prioridad == '1'
puts "Alta"
when prioridad == '2'
puts "Media"
else
puts "Baja"
end
end
This didn't worked.
Regars