Skip to content

Instantly share code, notes, and snippets.

@adamcarlile
Created November 25, 2010 12:38
Show Gist options
  • Save adamcarlile/715327 to your computer and use it in GitHub Desktop.
Save adamcarlile/715327 to your computer and use it in GitHub Desktop.
module GravatarHelper
def gravatize(email, options={})
default_options = {:size => 60}
options = default_options.update(options)
crypted_email = Digest::MD5.hexdigest(email)
output = "http://www.gravatar.com/avatar/#{crypted_email}?s=#{options[:size]}"
return image_tag(output)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment