gravatar_image_tag

A configurable and documented Rails view helper for adding gravatars into your Rails application

MIT License

Downloads
1.6M
Stars
367
Committers
7

!http://s.gravatar.com/images/logo.png(Gravatar Logo)!

h1. Gravatar Image Tag Plugin

Rails view helper for grabbing "Gravatar":http://en.gravatar.com/ images. The goal here is to be configurable and have those configuration points documented!

h2. Install as a Ruby Gem

h3. Rails 2

p. Include the following line in your Rails environment

p. Then ensure the gem is installed by running the following rake task from the your application root.

h3. Rails 3

p. Include the following line in your Rails environment

p. Then ensure the gem is installed by running the following command from the application root.

h2. Install as a Ruby on Rails Plugin

h2. Usage

h3. Gravatar Image Tag

p. Once you have installed it as a plugin for your rails app usage is simple.

Boom here is my gravatar !http://www.gravatar.com/avatar/4da9ad2bd4a2d1ce3c428e32c423588a(Michael Deering)!

h3. Gravatar Image URL

p. You can also return just the Gravatar URL:

p. Useful when used in your inline CSS.

h2. Configuration

h3. Global configuration points

h3. Setting the default image inline

p. Splat the default gravatar image !http://www.gravatar.com/avatar/0c821f675f132d790b3f25e79da739a7(Default Gravatar Image)!

p. You can set the default gravatar image inline as follows:

p. Ka-Pow !https://assets.github.com/images/gravatars/gravatar-140.png(Github Default Gravatar)!

p. Other options supported besides an image url to fall back on include the following:

h3. Setting the default image size

p. You can set the gravatar image size inline as follows:

Mini Me! !(some-class)http://www.gravatar.com/avatar/4da9ad2bd4a2d1ce3c428e32c423588a?size=15(Michael Deering)!

h3. Grabbing gravatars from the secure gravatar server.

p. You can make a request for a gravatar from the secure server at https://secure.gravatar.com by passing the :gravatar => { :secure => true } option to the gravatar_image_tag call.

Delivered by a secure url! !https://secure.gravatar.com/avatar/4da9ad2bd4a2d1ce3c428e32c423588a(Michael Deering)!

h3. Using Gravatar's built in rating system

p. You can set the gravatar rating inline as follows:

h3. Specifying a filetype

p. You can set the gravatar filetype inline as follows:

h2. Credits

The ideas and methods for this plugin are from expanding upon my original blog post "Adding Gravatar To Your Website Or Blog (Gravatar Rails)":http://mdeering.com/posts/005-adding-gravitar-to-your-website-or-blog

Copyright (c) 2009-2010 "Michael Deering(Ruby on Rails Development Edmonton)":http://mdeering.com, released under the MIT license