2:Fixnum 的未定义方法`merge' [英] undefined method `merge' for 2:Fixnum
本文介绍了2:Fixnum 的未定义方法`merge'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到以下错误
未定义方法`merge' for 2:Fixnum
undefined method `merge' for 2:Fixnum
代码
f.check_box "page[group_ids][]", g.id
请提出解决方案.
谢谢
推荐答案
你应该使用 check_box_tag
而不是 f.check_box
.
You should use check_box_tag
instead of f.check_box
.
check_box_tag "page[group_ids][]", g.id
区别在于 f.check_box
适用于模型有界表单,提供给复选框的值是给定模型的隐式值,不需要提供.
The difference is f.check_box
is for model-bounded forms and the value supplied to the check box is implicit from the given model and doesn't need to be provided.
这篇关于2:Fixnum 的未定义方法`merge'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文