Easily generate facebook opengraph data from your models
From your rails directory
script/plugin install http://github.com/capotej/has_opengraph.git
class Movie < ActiveRecord::Base
has_opengraph :title => :name,
:url => :get_url,
:image => :cover_image_url,
:description => :desc,
:type => "movie",
:site_name => "moviesite.com"
def get_url
self.permalink
end
end
<html>
<head>
<%= yield :fb %>
</head>
<body>
<%= yield %>
</body>
</html>
<% content_for :fb do %>
@movie.draw_opengraph
<% end %>
<div class="movie">
<h1><%= @movie.title %></h1>
</div>
<div class="movie-comments">
<span><%= @movie.like_button %></span>
</div>
Copyright (c) 2010 Julio Capote, released under the MIT license