Forum: Ruby on Rails Module level layouts and controllers

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.
Doug B. (Guest)
on 2006-02-21 20:31
(Received via mailing list)
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
the frontend and one is the backend.  However, I'd like a layout for
module area as obviously the two will be quite different although in
cases the functionality (controller) maybe very similar.

Any pointers would be very gratefully recieved.

All the best.

Joshua S. (Guest)
on 2006-02-21 22:37
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.


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

This topic is locked and can not be replied to.