aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-02-10 13:10:46 -0600
committerJoshua Peek <josh@joshpeek.com>2009-02-10 13:10:46 -0600
commitf400209084fabb00e18c3325e1933f4543fce94c (patch)
tree8c124158cbd5ea41463cbb59531454e95fc05efc /actionpack/lib/action_view
parent199e750d46c04970b5e7684998d09405648ecbd4 (diff)
downloadrails-f400209084fabb00e18c3325e1933f4543fce94c.tar.gz
rails-f400209084fabb00e18c3325e1933f4543fce94c.tar.bz2
rails-f400209084fabb00e18c3325e1933f4543fce94c.zip
Move checkbox hidden field before the actual checkbox so the actual value doesn't get clobbered [#1863 state:resolved]
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 0651f75cfb..3925978217 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -753,7 +753,9 @@ module ActionView
end
options["checked"] = "checked" if checked
add_default_name_and_id(options)
- tag("input", options) << tag("input", "name" => options["name"], "type" => "hidden", "value" => options['disabled'] && checked ? checked_value : unchecked_value)
+ hidden = tag("input", "name" => options["name"], "type" => "hidden", "value" => options['disabled'] && checked ? checked_value : unchecked_value)
+ checkbox = tag("input", options)
+ hidden + checkbox
end
def to_boolean_select_tag(options = {})