aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-03-13 13:36:59 -0700
committerPiotr Sarnacki <drogus@gmail.com>2012-03-13 13:36:59 -0700
commit663b66fd538fc2f637f09bb27aad65449585f226 (patch)
tree375f7ed8c9d48e636da5736d5a6ec6c38a25d86a /actionpack/lib
parent919db1bbbb9c2565c2dc1816812b7031f74b4e8e (diff)
parent9fbb1767b5b072007678b1df2bd59dce17c37dc8 (diff)
downloadrails-663b66fd538fc2f637f09bb27aad65449585f226.tar.gz
rails-663b66fd538fc2f637f09bb27aad65449585f226.tar.bz2
rails-663b66fd538fc2f637f09bb27aad65449585f226.zip
Merge pull request #5420 from lest/patch-2
add include_hidden option to checkbox tag
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/tags/check_box.rb10
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