easy gravitar for Rails

On 2013/03/07, in rails, ruby, signal, by a b

So, I just used Michael Deering’s handy gem for a gravitar_image_tag. Two lines of code and I have a gravitar in my app header.

Yay! I love the way the coding community works these days. It also helps that I’m working on stuff that’s a few years behind the curve…

I ended up wanting this to be available as a helper on the model, so I just wrote what I needed myself:

  def gravatar_url
    mailhash = Digest::MD5.hexdigest email
    return "http://www.gravatar.com/avatar/" + mailhash

That’s all that is.

Tagged with:

Comments are closed.