# Engines layout/helper problem

**URL:** <https://www.ruby-forum.com/t/engines-layout-helper-problem/51827>\
**Category:** Engines Development\
**Created:** [January 7, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/engines-layout-helper-problem/51827 "2006-01-07T20:49:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewkendall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b77776/32.png) [@andrewkendall](https://www.ruby-forum.com/u/andrewkendall)\
**Post date:** [January 7, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/engines-layout-helper-problem/51827/1 "2006-01-07T20:49:12Z")

</div>

Greeting,

So I finally decided to start playing around with Rails Engines.  
After getting my initial controller problem solved (and I see it’s  
fixed in the 1.0.3 release), I have run into another issue which is  
giving me a headache.

When I hit my default controller (app/controllers/home\_controller.rb)  
everything works fine. I get my default layout and my helpers work.

When I hit my engine controller  
(vendor/plugins/daub\_engine/app/controllers/daub\_test\_controller.rb) I  
get my view (vendor/plugins/daub\_engine/app/views/daub\_test/index.rhtml)  
with no layout.

I tracked it down and found deep in  
actionpack-1.11.2/lib/action\_controller/layout.rb the method  
active\_layout is returning nil. In my default controller it returns  
‘application’. Turns out that  
self.class.read\_inheritable\_attribute(“layout”) is not returning  
‘application’ for my enging views. Not sure why that is.

Not one to be to discouraged, I added the line “layout ‘application’”  
to my engine controller. This successfully forced it to render my  
view with the application layout. Unfortunately, my default  
application helpers (app/helpers/application\_helper.rb) are not being  
loaded and I get an error that they are undefined methods.

At this point, I decided to turn to the mailing list and see if anyone  
can help shed some light on this problem.

Thanks,  
a
