Permalink
Browse files

put back hidden field for unchecked boxes, just in case

  • Loading branch information...
1 parent d15a9a2 commit 1740d9e4c457730d926533a2cf2fc49f4e7c6458 Jonathan Garvin committed Sep 28, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/composable_builders/components/tagged.rb
@@ -144,11 +144,16 @@ def build_radio_button(method, name, value = 0, checked = false)
def build_habtm_check_box(method, name, value)
@template.content_tag(:li,
- @template.check_box_tag("#{@object_name}[#{method}][]", value, @object.send(method).include?(value)) + name.to_s
+ @template.hidden_field_tag(habtm_tag_name(method), nil) +
+ @template.check_box_tag(habtm_tag_name(method), value, @object.send(method).include?(value)) + name.to_s
)
end
- def habtm_tag_name(association)
+ def habtm_tag_name(method)
+ "#{object_name}[#{method}][]"
+ end
+
+ def deprecated_habtm_tag_name(association)
"#{object_name}[#{association.singularize}_ids][]"
end
end

0 comments on commit 1740d9e

Please sign in to comment.