【发布时间】:2014-10-19 17:34:21
【问题描述】:
这里需要一些帮助...
我正在使用 country_select gem 将国家/地区拉到表单中的下拉列表中:
<%= f.label :country_code, "Country Traveled:" %>
<%= f.country_select :country_code, prompt: "Select a country" %>
上面的代码在我的表单中提取了完整的国家名称(即法国、德国等),但它在我的模型数据库中存储了 country_code(FR、DE)。
如何将完整的国家/地区名称存储在我的模型中?非常感谢您的回复!提前致谢!
【问题讨论】:
标签: ruby-on-rails model gem form-for