2013-09-21 31 views
0

下面是我跑進這裏所描述的情況,代碼check_box與fields_for

= f.fields_for :category do |fc| 
    = fc.check_box :is_visible 

http://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html#method-i-check_boxUnfortunately 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.

我不知道如何實施解決方案。請指教。

回答

0

它確實有效,問題是Unpermitted parameters: visible

允許在控制器中修改visible