Method: Padrino::Helpers::AssetTagHelpers#meta_tag

Defined in:
padrino-helpers/lib/padrino-helpers/asset_tag_helpers.rb

#meta_tag(content, options = {}) ⇒ String

Creates a meta element with the content and given options.

Examples:

meta_tag "weblog,news", :name => "keywords"
# Generates: <meta name="keywords" content="weblog,news" />

meta_tag "text/html; charset=UTF-8", 'http-equiv' => "Content-Type"
# Generates: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Parameters:

  • content (String)

    The content for the meta tag.

  • options (Hash) (defaults to: {})

    The html options for the meta tag.

Returns:

  • (String)

    Meta html tag with specified options.

[View source] [View on GitHub]

170
171
172
173
# File 'padrino-helpers/lib/padrino-helpers/asset_tag_helpers.rb', line 170

def meta_tag(content, options={})
  options = { "content" => content }.update(options)
  tag(:meta, options)
end