Module: Avatar::View::ActionViewSupport
- Includes:
- AbstractViewSupport
- Defined in:
- lib/avatar/view/action_view_support.rb
Instance Method Summary collapse
-
#avatar_tag(person, avatar_options = {}, html_options = {}) ⇒ Object
Generates an image_tag for the URL or path generated by avatar_url_for(
person
,avatar_options
).
Methods included from AbstractViewSupport
Instance Method Details
#avatar_tag(person, avatar_options = {}, html_options = {}) ⇒ Object
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.
15 16 17 18 19 |
# File 'lib/avatar/view/action_view_support.rb', line 15 def avatar_tag(person, ={}, ={}) return "" if person.nil? url = avatar_url_for(person, ) image_tag(url, ) end |