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 image_tag, 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