Image_tag refuses to work in email context

I have a model called ImageMailer derived from ActionMailer.
It contains a method called sent that takes some args and send email to
a recipient. Works fine. I am testing this in script/console.

I now want to start sending HTML email.
Content type is “text/html”.

I can successfully deliver HTML email using the template “sent.rhtml”

sent.rhtml is just a bit of HTML tags nothing exciting.

However, when try to include the helper function image_tag thusly:
<%= image_tag(“rails.png”, :size => “50x64”) %>

Irb angrily spews all sorts of unintelligable error messages. All I did
was add this single line of code. Nothing more. Any thought? Can I not
use image_tag in ActionMailer based models?


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