Forum: Ruby on Rails ActionMailer using wrong layouts on prod box

Posted by Josh Sharpe (crankharder)
on 2010-02-02 20:13
(Received via mailing list)
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?
Posted by Josh Sharpe (crankharder)
on 2010-02-02 20:22
(Received via mailing list)
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.
Posted by Artur Xxx (artur79)
on 2010-05-19 17:06
had the same problem, any solutions ?
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.