Gravatar pour les utilisateurs
This commit is contained in:
parent
605e8944ff
commit
65e5ab0761
|
@ -1,2 +1,10 @@
|
|||
module UsersHelper
|
||||
end
|
||||
def user_gravatar(user, options = {})
|
||||
options = {:alt => 'avatar', :class => 'avatar', :size => 80}.merge! options
|
||||
id = Digest::MD5::hexdigest(user.email.strip.downcase)
|
||||
url = 'http://www.gravatar.com/avatar/' + id + '.jpg?s=' + options[:size].to_s
|
||||
options.delete :size
|
||||
|
||||
image_tag(url, options)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue