Class: MetaTags::ContentTag

Inherits:
Tag show all
Defined in:
lib/meta_tags/content_tag.rb,
sig/lib/meta_tags/content_tag.rbs

Overview

Represents an HTML meta tag with content (). Content should be passed as a :content attribute.

Instance Attribute Summary

Attributes inherited from Tag

#attributes, #name

Instance Method Summary collapse

Methods inherited from Tag

#initialize, #serialize_iso8601_attributes

Constructor Details

This class inherits a constructor from MetaTags::Tag

Instance Method Details

#render(view) ⇒ String

Renders the tag in a Rails view.

Parameters:

  • instance of a Rails view.

Returns:

  • HTML string for the tag.



11
12
13
# File 'lib/meta_tags/content_tag.rb', line 11

def render(view)
  view.(name, attributes[:content], serialize_iso8601_attributes(attributes.except(:content)))
end