diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-02-10 13:10:46 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-02-10 13:10:46 -0600 |
commit | f400209084fabb00e18c3325e1933f4543fce94c (patch) | |
tree | 8c124158cbd5ea41463cbb59531454e95fc05efc /actionpack/lib | |
parent | 199e750d46c04970b5e7684998d09405648ecbd4 (diff) | |
download | rails-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')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 4 |
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 = {}) |