app/helpers/swimmers_helper.rb
# Returns a default (local) image URL for a non-associated swimmer or
# a goggler without a Gravatar image.
#
# Returns the Gravatar image link for an associated swimmer (a Goggler) with
# a valid Gravatar account and a custom image.
#
Returns a default (local) image URL for a non-associated swimmer or
a goggler without a Gravatar image.

Returns the Gravatar image link for an associated swimmer (a Goggler) with
a valid Gravatar account and a custom image.
Returns a default ( local ) image URL for a non - associated swimmer or a goggler without a Gravatar image . Returns the Gravatar image link for an associated swimmer ( a Goggler ) with a valid Gravatar account and a custom image .
def avatar_url( swimmer )
    default_url = 'img_radiography.jpg'
    if swimmer && swimmer.associated_user
      gravatar_id = Digest::MD5::hexdigest( swimmer.associated_user.email ).downcase
      default_uri = "http://master-goggles.org/images/img_radiography.jpg"
      escaped_url = CGI.escape( default_uri )
      "http://gravatar.com/avatar/#{ gravatar_id }.png?d=#{ escaped_url }"
    else
      default_url
    end
  end
def avatar_url ( swimmer ) default_url = 'img_radiography.jpg' if swimmer && swimmer . associated_user gravatar_id = Digest :: MD5 :: hexdigest ( swimmer . associated_user . email ) . downcase default_uri = "http://master-goggles.org/images/img_radiography.jpg" escaped_url = CGI . escape ( default_uri ) "http://gravatar.com/avatar/#{ gravatar_id }.png?d=#{ escaped_url }" else default_url end end
Returns a default (local) image URL for a non-associated swimmer or
a goggler without a Gravatar image.
Returns a default ( local ) image URL for a non - associated swimmer or a goggler without a Gravatar image .
# [Steve, 20140901] If this was Rails 4, a simple image_url() would have done the job: #      absolute_url = request.protocol + request.host_with_port + path_to_image( default_url ) # [Steve, 20140901] For development/testing (and production), we need a public-accessible server with the default image: # Pre-version5: #      default_uri = "https://s3-eu-west-1.amazonaws.com/goggles-assets/img_radiography.jpg" # Post-version5:
swimmer
<not_specific>