lib/fgraph/rails/fgraph_helper.rb in fgraph-0.3.0 vs lib/fgraph/rails/fgraph_helper.rb in fgraph-0.3.1

- old
+ new

@@ -79,8 +79,23 @@ :client_id => fgraph_config['app_id'], :client_secret => fgraph_config['app_secret'], :access_token => fgraph_access_token ) end + + # Return Facebook object picture url: http://graph.facebook.com/[id]/picture + # + # ==== Type Options + # * <tt>square</tt> - 50x50 (default) + # * <tt>small</tt> - 50 pixels wide, variable height + # * <tt>normal</tt> - 100 pixels wide, variable height + # * <tt>large</tt> - 200 pixels wide, variable height + # + def fgraph_picture_url(id, type=nil) + id = FGraph.get_id(id) + url = "http://graph.facebook.com/#{id}/picture" + url += "?type=#{type}" if type + url + end end end end \ No newline at end of file