Add gravatar picture to header

This commit is contained in:
riggraz
2019-08-19 17:42:13 +02:00
parent 7cae9d68c1
commit 35d55c1e71
6 changed files with 28 additions and 7 deletions

View File

@@ -8,6 +8,11 @@ class User < ApplicationRecord
self.role ||= :user
end
def gravatar_url
gravatar_id = Digest::MD5::hexdigest(email.downcase)
"https://secure.gravatar.com/avatar/#{gravatar_id}"
end
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable,
:confirmable