Sha256: 1de310d2d417e0f7a4afe65efe9efba2bbadb805b5f84bd936f7bfd36b0037bd

Contents?: true

Size: 754 Bytes

Versions: 9

Compression:

Stored size: 754 Bytes

Contents

require 'avatar/view/abstract_view_support'

module Avatar # :nodoc:
  module View # :nodoc:
    module ActionViewSupport
      include Avatar::View::AbstractViewSupport
      
      # Generates an image_tag for the URL or path generated by
      # avatar_url_for(+person+, +avatar_options+).  Passes additional
      # tag options from +html_options+.  Returns an empty string
      # if +person+ is nil.
      #
      # Because this method uses <code>image_tag</code>, Sources
      # can generate paths instead of absolute URLs.
      def avatar_tag(person, avatar_options={}, html_options={})
        return "" if person.nil?
        url = avatar_url_for(person, avatar_options)
        image_tag(url, html_options)
      end
      
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
gcnovus-avatar-0.0.7 lib/avatar/view/action_view_support.rb
gcnovus-avatar-0.2.0 lib/avatar/view/action_view_support.rb
krasivotokak-avatar-0.0.7 lib/avatar/view/action_view_support.rb
avatar-0.2.0 lib/avatar/view/action_view_support.rb
avatar-0.0.1 lib/avatar/view/action_view_support.rb
avatar-0.0.5 lib/avatar/view/action_view_support.rb
avatar-0.0.2 lib/avatar/view/action_view_support.rb
avatar-0.0.3 lib/avatar/view/action_view_support.rb
avatar-0.0.4 lib/avatar/view/action_view_support.rb