Module: CornStarch::GravatarHelper

Defined in:
app/helpers/corn_starch/gravatar_helper.rb

Overview

Gravatar Helper

Instance Method Summary collapse

Instance Method Details

#gravatar_img(email, size = 64, options = {}) ⇒ Object

Gravatar Image



11
12
13
# File 'app/helpers/corn_starch/gravatar_helper.rb', line 11

def gravatar_img email, size = 64, options = {}
  image_tag gravatar_url(email, size), options
end

#gravatar_url(email, size = 64) ⇒ Object

Gravatar URL



16
17
18
19
# File 'app/helpers/corn_starch/gravatar_helper.rb', line 16

def gravatar_url email, size = 64
  gravatar_id = Digest::MD5.hexdigest(email.downcase)
  "http://gravatar.com/avatar/#{gravatar_id}.png?s=#{size}"
end