Created
June 11, 2012 10:05
-
-
Save cgallagher/2909405 to your computer and use it in GitHub Desktop.
OG Endpoint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show | |
if request.user_agent.index('facebookexternalhit') | |
@thing = Thing.find(params[:id]) | |
add_meta :property => 'og:title', :content => @thing.title | |
add_meta :property => 'og:type', :content => "article" | |
add_meta :property => 'og:url', :content => @thing.url_to_the_content | |
add_meta {{:property => 'og:image', :content => @thing.image_url}} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to install the metatags gem as a part of your bundle:
gem "metatags", "0.1"