aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/form_tag_helper.rb
diff options
context:
space:
mode:
authorGuo Xiang Tan <tgx_world@hotmail.com>2014-11-21 17:44:24 +0800
committerGuo Xiang Tan <tgx_world@hotmail.com>2014-11-21 17:44:24 +0800
commite0e9d5bd8600c01de6b73487bf66046d179c0ed7 (patch)
tree6cb00db7baab9e3d2e462373a73dcc9fa38e552d /actionview/lib/action_view/helpers/form_tag_helper.rb
parent8ffc8da71360f0defcc4ac44d25c1732b3f73820 (diff)
downloadrails-e0e9d5bd8600c01de6b73487bf66046d179c0ed7.tar.gz
rails-e0e9d5bd8600c01de6b73487bf66046d179c0ed7.tar.bz2
rails-e0e9d5bd8600c01de6b73487bf66046d179c0ed7.zip
Fix select_tag generating tag when set to false.
Fixes https://github.com/rails/rails/issues/17701.
Diffstat (limited to 'actionview/lib/action_view/helpers/form_tag_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/form_tag_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb
index c0218fd55d..93c04fbec6 100644
--- a/actionview/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/form_tag_helper.rb
@@ -140,7 +140,9 @@ module ActionView
include_blank = ''
end
- option_tags = content_tag(:option, include_blank, value: '').safe_concat(option_tags)
+ if include_blank
+ option_tags = content_tag(:option, include_blank, value: '').safe_concat(option_tags)
+ end
end
if prompt = options.delete(:prompt)