问题
I use the gem 'country_select' to choose a country for a form on my rails app however when I go to a show or index action I see the stored value. Is there a method to convert the value to a full name string of the country?
[AU] => "Australia"
回答1:
The documentation includes how to get exactly what you want.
country = ISO3166::Country[country_code]
country.translations[I18n.locale.to_s] || country.name
来源:https://stackoverflow.com/questions/32193447/country-select-display-full-country-name-on-show-action