Re: Location of Nested Controller Layout Files

DeLynn Berry
Fri, 03 Feb 2006 23:19:34 -0000

Another quick observation.

Would it also make sense for a Admin::UsersController to first look
for a layouts/admin/application.rhtml file first before looking for
the layouts/admin/users.rhtml file?

This would allow one to easily create different layouts for the
different sub-sections of an application without having to specify the
layout in the controller or creating a seperate layout file for every
controller in their "admin" section.

--
DeLynn Berry
delynn@gmail.com
http://www.delynnberry.com

On 2/3/06, DeLynn Berry <delynn@gmail.com> wrote:
> I had a hard time finding any documentation on if or how layout files
> worked with nested controllers. After trying a few thing myself (e.g.
> adding a admin/users.rhtml file and a admin_users.rhtml file to the
> layouts directory) and not seeing the expected results, I decided to
> look at the source to see if support for this was included. After
> looking around in the Layouts Module I learned that one needs to first
> create a "controller" directory inside of layouts and then the
natural
> admin/users.rhtml file would work.
>
> I''m wondering if it might be easier to eliminate this extraneous
> directory? Is there a reason for this current behavior that I am just
> unfamiliar with (like Components or something)?
>
> Thanks.
>
> --
> DeLynn Berry
> delynn@gmail.com
> http://www.delynnberry.com