diff --git a/actionview/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb index 09923be56819d0b98028c3571b2438d1b58e195b..57bfa0156807b2b290c84cff0c5552d27925490a 100644 --- a/actionview/lib/action_view/helpers/tag_helper.rb +++ b/actionview/lib/action_view/helpers/tag_helper.rb @@ -41,7 +41,7 @@ def tag_string(name, content = nil, escape_attributes: true, **options, &block) if VOID_ELEMENTS.include?(name) && content.nil? "<#{name.to_s.dasherize}#{tag_options(options, escape_attributes)}>".html_safe else - content_tag_string(name.to_s.dasherize, content || '', options, escape_attributes) + content_tag_string(name.to_s.dasherize, content || ''.freeze, options, escape_attributes) end end