Last week I got around to wrapping up my old Gravatar solution into an actual configurable Ruby on Rails plugin and hosting it over on GitHub .

Gravatar Logo

Here is some example usage and configuration examples.

Install as you would any other plugin


./script/plugin install git://github.com/mdeering/gravatar_image_tag.git

Basic usage


gravatar_image_tag('spam@spam.com'.gsub('spam', 'mdeering'), :alt => 'Michael Deering')

Configuration Points

Change the default image to your own rather then using the one set by Gravitar


# config/initializers/gravatar_defaults.rb
ActionView::Base.default_gravatar_image  = 'http://assets.yourhost.com/images/default_gravatar.png'

Change the default (80px x 80px) size of the gravatars on your site.


# config/initializers/gravatar_defaults.rb
ActionView::Base.default_gravatar_size  = 120

Full usage and documentation is avalible in the gravatar_image_tag plugin repository on GitHub .