How to i18n dropdown menu values. populated from database table.

14 views
Skip to first unread message

Pavel Krejsa

unread,
Nov 8, 2014, 10:02:29 AM11/8/14
to rubyonra...@googlegroups.com

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

Reply all
Reply to author
Forward
0 new messages