# frozen_string_literal: true
module UsersHelper
  # Returns the Gravatar for the given user.
  def gravatar_for(user)
    gravatar_id = Digest::MD5.hexdigest(user.email.downcase)
    gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}"
    image_tag(gravatar_url, alt: user.name, class: 'gravatar')
  end
end

# frozen_string_literal: true
module UsersHelper
  # Returns the Gravatar for the given user.
  def gravatar_for(user)
    gravatar_id = Digest::MD5.hexdigest(user.email.downcase)
    gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?d=mm"
    image_tag(gravatar_url, alt: user.name, class: 'gravatar')
  end
end

Use "mystery man" if there's no Gravatar image
Use "mystery man" if there's no Gravatar image

Use a simple (not distracting) "mystery man" image if there's
no gravatar image for a given user.

Signed-off-by: David A. Wheeler <9ae72d22d8b894b865a7a496af4fab6320e6abb2@dwheeler.com>
