Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gravatar Image Helper Function. Provide an email, it will return image_tag for corresponding gravatar. Pass in options hash as usual
def gravatar_image(email, options = {})
gravatar_url = "http://www.gravatar.com/avatar"
gravatar_hash = Digest::MD5.hexdigest(email.downcase.strip)
image_tag "#{gravatar_url}/#{gravatar_hash}", options
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment