Created
August 12, 2013 16:47
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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