In my project, I'm using enumerated_attribute, but I need to display the options in the right language.
I added a new options ":localize", and if it's set to true, then the labels are translated.
Example:
enum_attr :currency, %w(en ja), :init => I18n.locale, :localize => true do
label :en => "dollar"
label :ja => "yen"
end
Then if the website is in Japanese I will see 円 and if it is in English I will see ¥.
In my project, I'm using enumerated_attribute, but I need to display the options in the right language. I added a new options ":localize", and if it's set to true, then the labels are translated. Example:
Then if the website is in Japanese I will see 円 and if it is in English I will see ¥.