Forum: Ruby on Rails namespaced application layout?

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.
Elliott G. (Guest)
on 2009-06-06 03:53
(Received via mailing list)
I have an admin namespace in my app. I would like to have a layout
that would work like app/layouts/application.html.erb, but instead off
affecting the entire app it would only affect all the views inside of

How would this be done?

Maurício L. (Guest)
on 2009-06-06 07:03
(Received via mailing list)
Create a basic admin controller, like this:

class Admin::BaseController < ApplicationController
    layout :admin

Then make all admin controllers inherit from it. And also create an
layouts/admin.html.erb file ;)

Maurício Linhares (pt-br) | (en)
Elliott G. (Guest)
on 2009-06-07 22:29
(Received via mailing list)
Thanks Maurício.

That worked nicely.

On Jun 5, 11:02 pm, Maurício Linhares <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.