country_select 在表演动作中显示完整的国家名称

country_select display full country name on show action

我使用 gem 'country_select' 为我的 rails 应用程序中的表格选择国家/地区,但是当我去看表演或索引操作时,我会看到存储的值。有没有办法把值转换成国家的全名字符串?

[AU] => "Australia"

文档包括如何获取 exactly what you want

country = ISO3166::Country[country_code]
country.translations[I18n.locale.to_s] || country.name