如何使用带有 simple_form 的 country_select gem 列出选择中的所有国家 [英] How to list all countries in select using country_select gem with simple_form
本文介绍了如何使用带有 simple_form 的 country_select gem 列出选择中的所有国家的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已将 gem 'country-select'
添加到我的 gemfile 中,我需要在一个选择中列出所有国家/地区.我尝试 <%= f.input :country, as: :select %>
但国家没有出现.文档中没有关于此的信息.请帮我解决这个问题.
I have added gem 'country-select'
to my gemfile, and I need to list all countries in a select. I try <%= f.input :country, as: :select %>
but countries don't appear. There are no info about that in documentation. Please help me with this issue.
推荐答案
试试这个
<%= f.input :country, as: :country %>
这篇关于如何使用带有 simple_form 的 country_select gem 列出选择中的所有国家的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文