app/helpers/users_helper.rb
# Returns the Gravatar for the given user.
Returns the Gravatar for the given user.
Returns the Gravatar for the given user .
def gravatar_for(user, size: 80)
    if current_school.gravatar && user.gravatar
      gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
      gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}"
      image_tag(gravatar_url, alt: user.name, class: "gravatar")
    else
      "<div class='gravatar center' style='width:#{size}px;height:#{size}px;font-size:#{size/2}px;padding-top:#{size/(20/3)}px;background-color:#{user_colour(user)}'>#{user.name.split[0][0]}#{user.name.split[1][0]}</div>".html_safe
    end
  end
def gravatar_for ( user , size : 80 ) if current_school . gravatar && user . gravatar gravatar_id = Digest :: MD5 :: hexdigest ( user . email . downcase ) gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}" image_tag ( gravatar_url , alt : user . name , class : "gravatar" ) else "<div class='gravatar center' style='width:#{size}px;height:#{size}px;font-size:#{size/2}px;padding-top:#{size/(20/3)}px;background-color:#{user_colour(user)}'>#{user.name.split[0][0]}#{user.name.split[1][0]}</div>" . html_safe end end
Returns the Gravatar for the given user.
Returns the Gravatar for the given user .
#image_tag("user-img.jpg", size: size, alt: user.name, class: "gravatar")
user
<not_specific>
size
<not_specific>