# Actionmailer & picture

**URL:** <https://www.ruby-forum.com/t/actionmailer-picture/107077>\
**Category:** Rails\
**Created:** [June 17, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/actionmailer-picture/107077 "2007-06-17T20:32:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@miked](https://www.ruby-forum.com/u/miked)\
**Post date:** [June 17, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/actionmailer-picture/107077/1 "2007-06-17T20:32:25Z")

</div>

Hello

I’m using action mailer to create an HMTL outbound email. This email  
renders a partial. In that partial, a call is made to a public location  
to get a picture for display in the email.

When this email is generate, I get the following error (note: I’m sure  
it has something to do with not understanding the context of  
actionmailer and how it functions):

NoMethodError in Messages#send\_gmessage

Showing app/views/goalbuddies/\_gbdisplay.rhtml where line #9 raised:

undefined method `request’ for #UserMailer:0x44c58ac

Extracted source (around line #9):

6: \<% if p.nil? %\>  
7: \<%= image\_tag(“no\_pic.jpg”, :alt =\> “user picture”, :class =\>  
“friendPic”) %\>  
  
8: \<% else %\>  
9: \<%= image\_tag(p.public\_filename(:small), :alt =\> “user picture”,  
:class =\> “friendPic”)%\>  
10: \<% end %\>  
11:   
12:

Trace of template inclusion:  
/app/views/user\_mailer/vic\_announcement.rhtml

RAILS\_ROOT: ./script/…/config/…  
Application Trace | Framework Trace | Full Trace

C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action\_view/helpers/asset\_tag\_helper.rb:207:in  
`compute_public_path' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/asset_tag_helper.rb:164:in`image\_path’  
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action\_view/helpers/asset\_tag\_helper.rb:188:in  
`image_tag' #{RAILS_ROOT}/app/views/goalbuddies/_gbdisplay.rhtml:9:in`\_run\_rhtml\_47app47views47goalbuddies47\_gbdisplay46rhtml’  
#{RAILS\_ROOT}/app/views/user\_mailer/vic\_announcement.rhtml:14:in  
`_run_rhtml_47app47views47user_mailer47vic_announcement46rhtml' #{RAILS_ROOT}/app/controllers/messages_controller.rb:397:in`send\_gmessage’  
#{RAILS\_ROOT}/app/controllers/messages\_controller.rb:368:in `each' #{RAILS_ROOT}/app/controllers/messages_controller.rb:368:in`send\_gmessage’

Thanks very much in advance for your help!

Mike

---

<div class="post-metadata">

**Author:** ![miked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@miked](https://www.ruby-forum.com/u/miked)\
**Post date:** [June 18, 2007, 3:09pm UTC](https://www.ruby-forum.com/t/actionmailer-picture/107077/2 "2007-06-18T15:09:51Z")

</div>

Any help with this one? Thanks!
