Created
January 16, 2018 15:07
-
-
Save Nursultan91/d31938a230462558f8d05a53db1796c5 to your computer and use it in GitHub Desktop.
Граватар
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def avatar_url(user) | |
gravatar_id = Digest::MD5::hexdigest(user.email).downcase | |
if user.image | |
user.image | |
else | |
return "https://www.gravatar.com/avatar/#{gravatar_id}.jpg?d=identicon&s=50" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment