Pavel Krejsa
2014-Nov-08 15:02 UTC
How to i18n dropdown menu values. populated from database table.
I have *cargo* form with dropdown menu in *simple_forms*, which is
populated from model *cargo_price*:
<%= f.association :cargo_price, :label_method => :price, :value_method
=> :id
%>
There is model called *cargo_price* with only *ID* and *price* columns, *price
*column has 3 values (these values are populated to dropdown menu via that
association) . I would like to i18n this populated menu. Is there any best
practice for such a case? I tried without success to put translation to
yaml file:
en:
simple_forms:
options:
price:
allin: 'All in'
pp: '40 PlusPLus'
makeoffer: 'Offer'
thanx a lot
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/ea1a632e-3d04-4abc-a64f-ed3436d62d0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.