这是代码
= f.fields_for :category do |fc|
= fc.check_box :is_visible
我遇到了这里描述的情况http://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html#method-i-check_box Unfortunately that workaround does not work when the check box goes within an array-like parameter, as in ...
发生的情况是,在未选中复选框的情况下更新模型时,is_visible 保持为真。此问题已记录在案,建议的修复方法是In that case it is preferable to either use check_box_tag or to use hashes instead of arrays.
我不知道如何实施该解决方案。请指教。