Sha256: e5f3e9c6ead5d710a72ee1683b8d75b942d6e48bd8b7e2458cfccd7d53d08455

Contents?: true

Size: 342 Bytes

Versions: 7

Compression:

Stored size: 342 Bytes

Contents

module Trestle
  module AvatarHelper
    def avatar(&block)
      content_tag(:div, class: "avatar", &block)
    end

    def gravatar(email, options={})
      url = "https://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.to_s.downcase)}.png"
      url << "?#{options.to_query}" if options.any?

      image_tag(url)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trestle-0.8.7 app/helpers/trestle/avatar_helper.rb
trestle-0.8.6 app/helpers/trestle/avatar_helper.rb
trestle-0.8.5 app/helpers/trestle/avatar_helper.rb
trestle-0.8.4 app/helpers/trestle/avatar_helper.rb
trestle-0.8.3 app/helpers/trestle/avatar_helper.rb
trestle-0.8.2 app/helpers/trestle/avatar_helper.rb
trestle-0.8.0 app/helpers/trestle/avatar_helper.rb