formtastic check_boxes using collection not saving checked items in edit form

倖福魔咒の 提交于 2019-12-11 09:55:09

问题


I know this was supposed to be fixed in Formtastic 2.0 but for some reason, this isn't working for me.

          <%= f.input :gender, :as => :check_boxes, :collection => ["Male", "Female", "Unisex"] %>      

Whenever I go back and check it, the items is always unchecked again. It never appears as selected. I know Justin French commented about it here, but I am not sure what it means or how that can help me fix the problem.

I am saving gender as a string in the User model if it makes a difference.

I am also using it with formtastic-bootstrap 1.1.1

Thank you!

来源:https://stackoverflow.com/questions/9727890/formtastic-check-boxes-using-collection-not-saving-checked-items-in-edit-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!