Forum: Ruby on Rails Turning off the layout in ActionMailer?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Danimal (Guest)
on 2009-03-26 06:34
(Received via mailing list)
So I'm happy to see that ActionMailer supports layouts now (it may
have for a while, but I just now realized it).

But I don't see a way to turn them off selectively or by multipart

For example, if I have a layout that's really simple in "layouts/

<div style="border:1px solid gray">
  <%= yield %>

I can then use that in my ActionMailer class with a line at the top:
layout 'email'

But when I use multipart and have an HTML and a PLAIN file, they both
use the layout and thus the plain contains the <div> tag.

Is there any way to avoid this? or turn it off in certain cases?


Danimal (Guest)
on 2009-03-26 21:27
(Received via mailing list)
Found it: have to monkeypatch but at least it's simple:

Hopefully that'll soon go in as a bug fix. (and maybe it is for 2.3.
I'm still on 2.2.2)


P.S. I posted just in case this helps someone else.
This topic is locked and can not be replied to.