Forum: Ruby on Rails Module level layouts and controllers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
32ba8c5c148da2653028dc7f8066b810?d=identicon&s=25 Doug Bromley (ashiro)
on 2006-02-21 19: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
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
17acfbd3a05cfb59e0543235cc0a813b?d=identicon&s=25 Joshua Susser (Guest)
on 2006-02-21 21:37
Doug Bromley 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
This topic is locked and can not be replied to.