Skip to content

Instantly share code, notes, and snippets.

@cblanc
Created August 12, 2013 16:47
Show Gist options
  • Save cblanc/6212734 to your computer and use it in GitHub Desktop.
Save cblanc/6212734 to your computer and use it in GitHub Desktop.
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