2. + User profiles looking a little plain? Add a gravatar to
give them some personality. It’s easy!
3. +
Step 1: Add an MD hash of the
user’s email to the user model
The MD5 message-digest algorithm is a widely used
cryptographic hash function producing a 128-bit (16-byte) hash
value, typically expressed in text format as a 32 digit
hexadecimal number. MD5 has been utilized in a wide variety
of cryptographic applications, and is also commonly used to
verify data integrity.
MD5 - Wikipedia, the free encyclopedia
9. + Images can be resized by adding ?s=xxx to your helper code like
so:
url = "https://secure.gravatar.com/avatar/#{user.gravatar_id}?s=200"
10. + If your user hasn’t registered a gravatar, a default
image appears.
11. +
That’s all there is to it.
For more info see the Gravatar website:
https://en.gravatar.com/site/implement/
Example code:
https://github.com/catfriend/gravatar_example