Skip to content

Instantly share code, notes, and snippets.

@rocknrollMarc
Created August 24, 2016 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rocknrollMarc/8afed8ac5f28ca0984d58f5020d008a7 to your computer and use it in GitHub Desktop.
Save rocknrollMarc/8afed8ac5f28ca0984d58f5020d008a7 to your computer and use it in GitHub Desktop.
module ApplicationHelper
def gravatar_for(user, opts = {})
opts[:alt] = user.name
image_tag "https://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user.email)}?s=#{opts.delete(:size) { 40 }}",
opts
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment