Forum: Rails Engines development engines layout/helper problem

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.
Andrew K. (Guest)
on 2006-01-07 21:49
(Received via mailing list)

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.

This topic is locked and can not be replied to.