method

tag_string

rails latest stable - Class: ActionView::Helpers::TagHelper::TagBuilder
tag_string(name, content = nil, escape: true, **options, &block)
public

No documentation available.

# File actionview/lib/action_view/helpers/tag_helper.rb, line 69
        def tag_string(name, content = nil, escape: true, **options, &block)
          content = @view_context.capture(self, &block) if block_given?
          self_closing = SVG_SELF_CLOSING_ELEMENTS.include?(name)
          if (HTML_VOID_ELEMENTS.include?(name) || self_closing) && content.nil?
            "<#{name.to_s.dasherize}#{tag_options(options, escape)}#{self_closing ? " />" : ">"}".html_safe
          else
            content_tag_string(name.to_s.dasherize, content || "", options, escape)
          end
        end