Class: MetaTags::ContentTag

Inherits:
Tag
  • Object
show all
Defined in:
lib/meta_tags/content_tag.rb

Overview

Represents an HTML meta tag with content (<tag></tag>). 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

Constructor Details

This class inherits a constructor from MetaTags::Tag

Instance Method Details

#render(view) ⇒ String

Render tag into a Rails view.

Parameters:

  • view (ActionView::Base)

    instance of a Rails view.

Returns:

  • (String)

    HTML string for the tag.



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

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