module Metanol::Helpers

Public Instance Methods

current_url() click to toggle source

Return a current URL

# File lib/metanol/helpers.rb, line 35
def current_url
  request.original_url
end
metanol_og_tags() click to toggle source

Render OpenGraph meta tags

# File lib/metanol/helpers.rb, line 13
def metanol_og_tags
  result = metanol_render_tags ::Metanol::Meta::OpenGraph
  result << ::Metanol::Meta::OpenGraph.render_current_url(current_url)
  result.html_safe
end
metanol_tags() click to toggle source

Render all meta tags

# File lib/metanol/helpers.rb, line 4
def metanol_tags
  result = ''
  SUPPORT_GROUPS.keys.each do |type|
    result << send("metanol_#{type}_tags")
  end
  result.html_safe
end

Private Instance Methods

metanol_render_tags(type) click to toggle source
# File lib/metanol/helpers.rb, line 41
def metanol_render_tags(type)
  result = ''
  metanols = controller.class.common_metanols.merge(controller.action_metanols)
  metanols.each_value do |value|
    next unless value.is_a? type

    result << value.render
  end
  result
end