Sha256: 01dddfafde0ffc5d5ca1484d21afb32cd8e3ebc9f6528dd807802c7577d0eeda

Contents?: true

Size: 483 Bytes

Versions: 17

Compression:

Stored size: 483 Bytes

Contents

module Guts
  # View helpers for users
  module UsersHelper
    # Gets the user's gravatar
    # @param [Object] user the user's object
    # @return [String] the image HTML
    # @note Sets a class of `gravatar` to the image HTML
    def gravatar_for(user)
      gravatar_id  = Digest::MD5.hexdigest user.email.downcase
      gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}"
      
      image_tag gravatar_url, alt: user.name, class: 'gravatar'
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
guts-2.1.0 app/helpers/guts/users_helper.rb
guts-2.0.2 app/helpers/guts/users_helper.rb
guts-2.0.1 app/helpers/guts/users_helper.rb
guts-2.0.0 app/helpers/guts/users_helper.rb
guts-1.4.0 app/helpers/guts/users_helper.rb
guts-1.3.6 app/helpers/guts/users_helper.rb
guts-1.3.5 app/helpers/guts/users_helper.rb
guts-1.3.4 app/helpers/guts/users_helper.rb
guts-1.3.3 app/helpers/guts/users_helper.rb
guts-1.3.2 app/helpers/guts/users_helper.rb
guts-1.3.1 app/helpers/guts/users_helper.rb
guts-1.3.0 app/helpers/guts/users_helper.rb
guts-1.2.2 app/helpers/guts/users_helper.rb
guts-1.2.1 app/helpers/guts/users_helper.rb
guts-1.2.0 app/helpers/guts/users_helper.rb
guts-1.1.1 app/helpers/guts/users_helper.rb
guts-1.1.0 app/helpers/guts/users_helper.rb