aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tags/base.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-03-13 10:51:46 -0700
committerPiotr Sarnacki <drogus@gmail.com>2012-03-13 10:51:46 -0700
commitcb7d19b66badfbd1846c195913419c331701074e (patch)
tree7b4ae49db122f70ab9669e4d896ad42f57685330 /actionpack/lib/action_view/helpers/tags/base.rb
parentdbdbe961cd41a5fa69d6e0e92943195e2fb4d279 (diff)
parent54a75e1a0f1c2369a9a4b2872c2213d32a8bc117 (diff)
downloadrails-cb7d19b66badfbd1846c195913419c331701074e.tar.gz
rails-cb7d19b66badfbd1846c195913419c331701074e.tar.bz2
rails-cb7d19b66badfbd1846c195913419c331701074e.zip
Merge pull request #5414 from nashby/select-hidden-input
add 'include_hidden' option to select tag, closes #5402
Diffstat (limited to 'actionpack/lib/action_view/helpers/tags/base.rb')
-rw-r--r--actionpack/lib/action_view/helpers/tags/base.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/base.rb b/actionpack/lib/action_view/helpers/tags/base.rb
index 14323a3891..7c2f12d8e7 100644
--- a/actionpack/lib/action_view/helpers/tags/base.rb
+++ b/actionpack/lib/action_view/helpers/tags/base.rb
@@ -122,7 +122,8 @@ module ActionView
html_options = html_options.stringify_keys
add_default_name_and_id(html_options)
select = content_tag("select", add_options(option_tags, options, value(object)), html_options)
- if html_options["multiple"]
+
+ if html_options["multiple"] && options.fetch(:include_hidden) { true }
tag("input", :disabled => html_options["disabled"], :name => html_options["name"], :type => "hidden", :value => "") + select
else
select