method
tag_string
v7.0.0 -
Show latest stable
- Class:
ActionView::Helpers::TagHelper::TagBuilder
tag_string(name, content = nil, escape_attributes: true, **options, &block)public
No documentation available.
# File actionview/lib/action_view/helpers/tag_helper.rb, line 68
def tag_string(name, content = nil, escape_attributes: true, **options, &block)
content = @view_context.capture(self, &block) if block_given?
if (HTML_VOID_ELEMENTS.include?(name) || SVG_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)
end
end