application_helper.rb 348 Bytes
Newer Older
mafolz's avatar
mafolz committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module ApplicationHelper

  require 'digest/md5'
  def gravatar_url_for(email, size=48)
    hash = Digest::MD5.hexdigest(email)
    "http://gravatar.com/avatar/#{hash}?s=#{size}"
  end

  def login_or_username
    if current_hacker.blank?
      link_to 'Einloggen', new_hacker_session_path 
    else
      current_hacker.nickname
    end
  end
end