def content_tag(name, content=nil, attrs={}, &body)
      if content.is_a?(Hash)
        attrs = content
        content = nil
      end

      if block_given?
        content = capture(&body)
      end

      tag = tag_opening(name, attrs)
      tag << ">".html_safe
      tag << content
      tag << "</#{name}>".html_safe
    end
def content_tag(name, content=nil, attrs={}, &body)
      if content.is_a?(Hash)
        attrs = content
        content = nil
      end

      if block_given?
        content = capture(&body)
      end

      tag = tag_opening(name, attrs)
      tag << ">".html_safe
      tag << content
      tag << "</#{name}>".html_safe
    end
Generates a with opening and closing tags and potentially content.

 @example Tag with no attributes, no content
   content_tag(:p) # => "<p></p>"

 @example Tag with content
   content_tag(:p, "Hello") # => "<p>Hello</p>"

 @example Tag with block content
   content_tag(:p) { "Hello" } # => "<p>Hello</p>"

 @example Tag with content and attributes
   content_tag(:a, "Log In", href: "/log_in") # => "<a href="/log_in">Log In</a>"

 @example Tag with content block and attributes
   content_tag(:a, href: "/log_in") { "Log In" } # => "<a href="/log_in">Log In</a>"

 @param name [Symbol, String] The name of the tag
 @param attrs [Hash] The attributes of the tag

 @return [String] The HTML tag