aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorDamien Mathieu <42@dmathieu.com>2012-01-06 17:14:49 +0100
committerDamien Mathieu <42@dmathieu.com>2012-01-06 18:08:29 +0100
commit69a6381048b2bbf97ee651afebf43d9095ec9075 (patch)
tree92962d0f8943602277d8e1f5d3aadfba337737d4 /actionpack/lib/action_view/helpers
parentaec817269f7df9641753c631d104d8b1dbdc610c (diff)
downloadrails-69a6381048b2bbf97ee651afebf43d9095ec9075.tar.gz
rails-69a6381048b2bbf97ee651afebf43d9095ec9075.tar.bz2
rails-69a6381048b2bbf97ee651afebf43d9095ec9075.zip
don't set the hidden checkbox value if it's nil
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 08c7fbc281..fdddb33c31 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -1091,7 +1091,7 @@ module ActionView
else
add_default_name_and_id(options)
end
- hidden = tag("input", "name" => options["name"], "type" => "hidden", "value" => unchecked_value, "disabled" => options["disabled"])
+ hidden = unchecked_value ? tag("input", "name" => options["name"], "type" => "hidden", "value" => unchecked_value, "disabled" => options["disabled"]) : ""
checkbox = tag("input", options)
hidden + checkbox
end