diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2012-03-13 23:17:49 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2012-03-13 23:17:49 +0300 |
commit | 9fbb1767b5b072007678b1df2bd59dce17c37dc8 (patch) | |
tree | 9f9d273447f713daaf39aa3ac9d2ecc51d0b9b05 /actionpack/lib | |
parent | a85714a673d2e06b923bd4eba443a3849d332cce (diff) | |
download | rails-9fbb1767b5b072007678b1df2bd59dce17c37dc8.tar.gz rails-9fbb1767b5b072007678b1df2bd59dce17c37dc8.tar.bz2 rails-9fbb1767b5b072007678b1df2bd59dce17c37dc8.zip |
add include_hidden option to checkbox tag
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/tags/check_box.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/check_box.rb b/actionpack/lib/action_view/helpers/tags/check_box.rb index 579cdb9fc9..1a4aebb936 100644 --- a/actionpack/lib/action_view/helpers/tags/check_box.rb +++ b/actionpack/lib/action_view/helpers/tags/check_box.rb @@ -25,9 +25,15 @@ module ActionView add_default_name_and_id(options) end - hidden = hidden_field_for_checkbox(options) + include_hidden = options.delete("include_hidden") { true } checkbox = tag("input", options) - hidden + checkbox + + if include_hidden + hidden = hidden_field_for_checkbox(options) + hidden + checkbox + else + checkbox + end end private |