Commit 5118985a authored by danielgrippi's avatar danielgrippi

include default image for FB for timeline

parent 35b0f763
......@@ -12,7 +12,8 @@ module OpenGraphHelper
end
def og_image(post)
tags = post.photos.map{|x| meta_tag_with_property('og:image', x.url(:thumb_large))} || []
tags = post.photos.map{|x| meta_tag_with_property('og:image', x.url(:thumb_large))}
tags << meta_tag_with_property('og:image', default_image_url) if tags.empty?
tags.join(' ')
end
......@@ -38,4 +39,15 @@ module OpenGraphHelper
def meta_tag_with_property(name, content)
content_tag(:meta, '', :property => name, :content => content)
end
private
# This method compensates for hosting assets off of s3
def default_image_url
if image_path('asterisk.png').include?("http")
image_path('asterisk.png')
else
"#{root_url.chop}#{image_path('asterisk.png')}"
end
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment