Module level layouts and controllers


#1

Is it at all possible to have a layout for a module?
For example I have a module called ‘admin’ and one called ‘shop’. One
is
the frontend and one is the backend. However, I’d like a layout for
each
module area as obviously the two will be quite different although in
some
cases the functionality (controller) maybe very similar.

Any pointers would be very gratefully recieved.

All the best.

Doug


#2

Doug B. wrote:

Is it at all possible to have a layout for a module?

I was looking for this the other day. Looks like EdgeRails has some
support for getting the right layout for a controller in a module, but
doesn’t yet have support for a default layout for all controllers in a
module. I’d love to see this too, though I do wonder what the name and
placement of the layout should be. I suppose for the admin module
something like the following would work. Note that I’ve added a special
layout in the admin module, but the default would be the admin.rhtml.

views/
-layouts/
–admin/
—special.rhtml
–admin.rhtml
–application.rhtml

I’ve looked at the Rails code for this just a bit, but I haven’t really
put in enough time to have an idea of how hard it would be to make this
happen.

–josh