module SocialMetaHelper
  def open_graph_tag(name, content, interpolation = {})
    if Symbol === content
      tag(:meta, property: "og:#{name}", content: t(content, interpolation.merge(scope: :'metadata.open_graph')))
    elsif name == 'image'
      tag(:meta, property: "og:image", content: path_to_image(content))
    else
      tag(:meta, property: "og:#{name}", content: content)
    end
  end

  def twitter_card_tag(name, content, interpolation = {})
    if Symbol === content
      tag(:meta, name: "twitter:#{name}", content: t(content, interpolation.merge(scope: :'metadata.twitter')))
    elsif name == 'image'
      tag(:meta, name: "twitter:image", content: path_to_image(content))
    else
      tag(:meta, name: "twitter:#{name}", content: content)
    end
  end
end

module SocialMetaHelper
  def open_graph_tag(name, content, interpolation = {})
    if Symbol === content
      tag(:meta, property: "og:#{name}", content: t(content, interpolation.merge(scope: :'metadata.open_graph')))
    elsif name == 'image'
      tag(:meta, property: "og:image", content: url_to_image(content))
    else
      tag(:meta, property: "og:#{name}", content: content)
    end
  end

  def twitter_card_tag(name, content, interpolation = {})
    if Symbol === content
      tag(:meta, name: "twitter:#{name}", content: t(content, interpolation.merge(scope: :'metadata.twitter')))
    elsif name == 'image'
      tag(:meta, name: "twitter:image", content: url_to_image(content))
    else
      tag(:meta, name: "twitter:#{name}", content: content)
    end
  end
end

Fix bug where open graph and Twitter cards expect an image URL
Fix bug where open graph and Twitter cards expect an image URL

not a path (even though they figure it out ;)
