Define a default value as suggested by ariejan
This commit is contained in:
parent
825d2d69af
commit
babb6a1a6b
1 changed files with 1 additions and 2 deletions
|
@ -1,9 +1,8 @@
|
|||
require 'digest/md5'
|
||||
module ApplicationHelper
|
||||
|
||||
def gravatar_icon(user_email, size = 40)
|
||||
def gravatar_icon(user_email = '', size = 40)
|
||||
gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com"
|
||||
user_email ||= ''
|
||||
user_email.strip!
|
||||
"#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue