Actionmailer & picture

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:inimage_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:insend_gmessage’
#{RAILS_ROOT}/app/controllers/messages_controller.rb:368:in each' #{RAILS_ROOT}/app/controllers/messages_controller.rb:368:insend_gmessage’

Thanks very much in advance for your help!

Mike

Any help with this one? Thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs