diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-06 09:12:11 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-06 09:12:11 -0800 |
commit | 365a34c92f7fa95605bc34ea2d5ac70da5790e9d (patch) | |
tree | 92962d0f8943602277d8e1f5d3aadfba337737d4 /actionpack/lib | |
parent | aec817269f7df9641753c631d104d8b1dbdc610c (diff) | |
parent | 69a6381048b2bbf97ee651afebf43d9095ec9075 (diff) | |
download | rails-365a34c92f7fa95605bc34ea2d5ac70da5790e9d.tar.gz rails-365a34c92f7fa95605bc34ea2d5ac70da5790e9d.tar.bz2 rails-365a34c92f7fa95605bc34ea2d5ac70da5790e9d.zip |
Merge pull request #4353 from dmathieu/hide_nil_unchecked_checkbox
don't set the hidden checkbox value if it's nil
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 2 |
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 |