aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-08-12 03:12:07 -0300
committerGitHub <noreply@github.com>2016-08-12 03:12:07 -0300
commit64d578517aeda06311e157eaa12a4b7d9919e08e (patch)
tree46040e745fbe79972609294418d92ce0649701e2 /actionpack/lib
parentfecc67d5152576eb9d918f6a2b90851e8fd6a23c (diff)
parentefd59ab38231eca1084e85aa990321599308757f (diff)
downloadrails-64d578517aeda06311e157eaa12a4b7d9919e08e.tar.gz
rails-64d578517aeda06311e157eaa12a4b7d9919e08e.tar.bz2
rails-64d578517aeda06311e157eaa12a4b7d9919e08e.zip
Merge pull request #26131 from smellsblue/dont-fail-on-non-string
Remove dead code and ensure values are strings before calling gsub
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/tag_helper.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb
index 6b659a7c00..e39c58ca32 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -147,7 +147,6 @@ module ActionView
elsif BOOLEAN_ATTRIBUTES.include?(key)
attrs << %(#{key}="#{key}") if value
elsif !value.nil?
- final_value = value.is_a?(Array) ? value.join(" ") : value
attrs << tag_option(key, value, escape)
end
end
@@ -159,7 +158,7 @@ module ActionView
if value.is_a?(Array)
value = escape ? safe_join(value, " ") : value.join(" ")
else
- value = escape ? ERB::Util.html_escape(value) : value
+ value = escape ? ERB::Util.html_escape(value) : value.to_s
end
%(#{key}="#{value.gsub(/"/, '&quot;'.freeze)}")
end