6

i get the following error

undefined method `merge' for 2:Fixnum

for the code

f.check_box "page[group_ids][]", g.id

please, suggest solution for this.

thanks

user229044
  • 232,980
  • 40
  • 330
  • 338
lamrin
  • 1,431
  • 4
  • 22
  • 34

1 Answers1

22

You should use check_box_tag instead of f.check_box.

check_box_tag "page[group_ids][]", g.id

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.

PeterWong
  • 15,951
  • 9
  • 59
  • 68
  • 1
    This is the reason that error is appearing, though: http://stackoverflow.com/a/6636888/2948832 – styger May 08 '15 at 20:25