Actionmailer & picture


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 %>

Trace of template inclusion:

RAILS_ROOT: ./script/…/config/…
Application Trace | Framework Trace | Full Trace

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’
image_tag' #{RAILS_ROOT}/app/views/goalbuddies/_gbdisplay.rhtml:9:in_run_rhtml_47app47views47goalbuddies47_gbdisplay46rhtml’
_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!


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