Module: Guts::UsersHelper
- Defined in:
- app/helpers/guts/users_helper.rb
Overview
View helpers for users
Instance Method Summary collapse
-
#gravatar_for(user, size = nil) ⇒ String
Gets the user’s gravatar.
Instance Method Details
#gravatar_for(user, size = nil) ⇒ String
Note:
Sets a class of ‘gravatar` to the image HTML
Gets the user’s gravatar
9 10 11 12 13 14 15 |
# File 'app/helpers/guts/users_helper.rb', line 9 def gravatar_for(user, size = nil) gravatar_id = Digest::MD5.hexdigest user.email.downcase gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}" gravatar_url << "?s=#{size}" unless size.nil? image_tag gravatar_url, alt: user.name, class: 'gravatar' end |