country_select在show action上显示完整的国家/地区名称

我使用gem’country_select’为我的rails应用程序选择一个表单的国家/地区,但是当我转到show或index操作时,我会看到存储的值。 有没有方法将值转换为国家/地区的全名字符串?

[AU] => "Australia" 

该文档包括如何准确获取您想要的内容 。

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