Skip to content

dukz/fb_opengraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fb_opengraph

Allows you to easily define and render Open Graph Protocol metadata within your ActiveRecord model definition.

Install

rails plugin install git://github.com/dukz/fb_opengraph.git

Quick Start

In your model: Create a map of Open Graph Protocol values with your model’s fields or methods

class Movie < ActiveRecord::Base

has_fb_opengraph :type => ‘movie’, :title => :title, :description => :description

end

In your layout: Create a yield block for the meta tags (I’d recommend using :fb_opengraph for conventions)

<html>

<head> … <%= yield :fb_opengraph %> … </head> …

</html>

In the view: Create a content_for block to render the Open Graph meta tags

<% content_for :fb_opengraph do %>
  <%= raw @movie.fb_opengraph_meta_tags(:url => movie_url(@movie)) %>
<% end %>

Copyright © 2010 Andrew Angelo Ang, released under the MIT license

About

Allows you to easily define and render Open Graph Protocol metadata within your ActiveRecord model definition.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages