Sha256: c402ebecd0f4e629d63a65b077c41d8affa88552586c2f19496aa7cb2b486b3b
Contents?: true
Size: 590 Bytes
Versions: 3
Compression:
Stored size: 590 Bytes
Contents
module Blogr module UserHelper def gravatar(email, options = {}) options[:size] ||= 35 options[:default] ||= "identicon" options[:rating] ||= "PG" options[:class] ||= "gravatar" options[:secure] ||= request.ssl? host = (options[:secure] ? "https://secure.gravatar.com" : "http://gravatar.com") path = "/avatar?gravatar_id=#{Digest::MD5.hexdigest(email)}&rating=#{options[:rating]}&size=#{options[:size] * 2}&d=#{options[:default]}" image_tag([host,path].join, :class => options[:class], :width => options[:size], :height => options[:size]) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
blogr-0.0.8 | app/helpers/blogr/user_helper.rb |
blogr-0.0.7 | app/helpers/blogr/user_helper.rb |
blogr-0.0.6 | app/helpers/blogr/user_helper.rb |