diff options
author | Angel N. Sciortino <contact@angeliccomputing.com> | 2013-09-24 13:42:06 -0500 |
---|---|---|
committer | Angel N. Sciortino <contact@angeliccomputing.com> | 2013-09-24 13:42:06 -0500 |
commit | 8ae80447262020e3ff5eda2e5f5bf73bd432b300 (patch) | |
tree | 60329a342e5e9912193faed41e8a1123ccaededa /actionview/lib | |
parent | b1178aef3b44bd9e0153d2c4f8a2a2a590949999 (diff) | |
download | rails-8ae80447262020e3ff5eda2e5f5bf73bd432b300.tar.gz rails-8ae80447262020e3ff5eda2e5f5bf73bd432b300.tar.bz2 rails-8ae80447262020e3ff5eda2e5f5bf73bd432b300.zip |
Use the given name in html_options for the hidden field in collection_check_boxes
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/tags/collection_check_boxes.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb b/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb index 52006d856b..9b77ebeb1b 100644 --- a/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb +++ b/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb @@ -27,7 +27,8 @@ module ActionView # Append a hidden field to make sure something will be sent back to the # server if all check boxes are unchecked. - hidden = @template_object.hidden_field_tag("#{tag_name}[]", "", :id => nil) + hidden_name = @html_options[:name] || "#{tag_name}[]" + hidden = @template_object.hidden_field_tag(hidden_name, "", :id => nil) rendered_collection + hidden end |