Method: ActionView::Helpers::TagHelper::TagBuilder#content_tag_string

Defined in:
actionview/lib/action_view/helpers/tag_helper.rb

#content_tag_string(name, content, options, escape = true) ⇒ Object



79
80
81
82
83
84
85
86
87
88
# File 'actionview/lib/action_view/helpers/tag_helper.rb', line 79

def (name, content, options, escape = true)
  tag_options = tag_options(options, escape) if options

  if escape
    name = ERB::Util.xml_name_escape(name)
    content = ERB::Util.unwrapped_html_escape(content)
  end

  "<#{name}#{tag_options}>#{PRE_CONTENT_STRINGS[name]}#{content}</#{name}>".html_safe
end