# ActionMailer using wrong layouts on prod box

**URL:** <https://www.ruby-forum.com/t/actionmailer-using-wrong-layouts-on-prod-box/182788>\
**Category:** Rails\
**Created:** [February 2, 2010, 8:13pm UTC](https://www.ruby-forum.com/t/actionmailer-using-wrong-layouts-on-prod-box/182788 "2010-02-02T20:13:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [February 2, 2010, 8:13pm UTC](https://www.ruby-forum.com/t/actionmailer-using-wrong-layouts-on-prod-box/182788/1 "2010-02-02T20:13:49Z")

</div>

Using ActionMailer, Haml and multi part emails I’m seeing very  
strange behavior on one particular production box.

I’ve got:

class Notifier \< ActionMailer::Base  
layout ‘email’  
def test  
end  
end

All of these files exist:  
app/views/notifier/test.text.html.haml  
app/views/notifier/test.text.plain.haml  
app/views/layouts/email.text.html.haml  
app/views/layouts/email.text.plain.haml

_Both_ parts of this multipart email use the HTML layout. However,  
each individual part uses the appropriate HTML/PLAIN template.

1. I’ve verified this isn’t related to Rails/ActionMailer or HAML by  
creating a barebones app with this identical set up and checking to  
see if it worked (it did)
2. If I set up a prod database on my dev box it works fine – This  
only happens in prod on my prod server… (big wtf there)

Both my dev and prod server say this:

> Notifier.instance\_variable\_get("@inheritable\_attributes")  
> =\> {:auto\_layout=\>false, :master\_helper\_module=\>#\<Module:  
> 0x2d72ac4\>, :layout\_conditions=\>{}, :view\_paths=\>["/Users/jsharpe/  
> veloracing/app/views"], :layout=\>“email”}  
> \*Note the :layout =\> “email” is correct

Where else can I troubleshoot this?

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [February 2, 2010, 8:22pm UTC](https://www.ruby-forum.com/t/actionmailer-using-wrong-layouts-on-prod-box/182788/2 "2010-02-02T20:22:36Z")

</div>

Few updates to the original post:

I’ve since changed the layouts to “notifier\_layout” in case there was  
some conflict with “email” – as didn’t fix it (as expected)

I tested it with ERB and a barebones rails 2.3.5 app – so yea, not  
Rails and not Haml’s fault

On prod Notifier.instance\_variable\_get("@inheritable\_attributes")  
[:view\_paths] is slightly different but looks fine… the rest of that  
hash is identical.

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [May 19, 2010, 5:06pm UTC](https://www.ruby-forum.com/t/actionmailer-using-wrong-layouts-on-prod-box/182788/3 "2010-05-19T17:06:41Z")

</div>

had the same problem, any solutions ?
