我一直在尝试实现 country_select gem 到我的应用程序中,以便用户可以在注册过程中选择一个国家(设计)。
我希望根据用户的区域设置翻译国家/地区列表。它实际上翻译成几 languages
有这个 gem i18n-country-translations ,其中包含许多不同语言的国家/地区列表。当我尝试选择国家/地区时如何实现这些翻译?
我还发现了来自同一作者的另一个 gem i18n_country_select .但是,当我尝试这样使用它时:
<%= f.country_code_select(:user, :country) %>
我得到一个错误:
undefined method `to_country_code_select_tag' for #<ActionView::Helpers::Tags::Select:0x007f182d81abe0>
最佳答案
你试过吗
f.country_select (:user, :country_code)
关于ruby-on-rails - Rails 4 - i18n country_select,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27221557/