简体   繁体   English

country_select gem 无法在 Rails 3 中使用 fields_for 嵌套表单

[英]country_select gem not working with fields_for nested form in Rails 3

Does anyone know how to get country_select to work with fields_for?有谁知道如何让 country_select 与 fields_for 一起工作?

https://github.com/stefanpenner/country_select https://github.com/stefanpenner/country_select

It doesn't seem to accept the model prefix, as do the other form field helpers in the nested form.它似乎不接受 model 前缀,嵌套表单中的其他表单字段助手也是如此。

If there is no way to make it work, is there another way to quickly/easily get a country selector field in my form?如果没有办法让它工作,是否有另一种方法可以快速/轻松地在我的表单中获取国家/地区选择器字段?

Thanks.谢谢。

I hope this code works:我希望这段代码有效:

<%= f.country_select :country,  :style=>'width:100px;'%>

Cheers mate !队友的欢呼声 !

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM