Forum: Ruby on Rails namespaced application layout?

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.
7bd5cba5820168467074439c6a03c76b?d=identicon&s=25 Elliott Golden (elliottg)
on 2009-06-06 01: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
Admin::*

How would this be done?

Thanks,
Elliott
A91bd6cef23eb3516245a092e196c4da?d=identicon&s=25 Maurício Linhares (mauricio)
on 2009-06-06 05:03
(Received via mailing list)
Create a basic admin controller, like this:

class Admin::BaseController < ApplicationController
    layout :admin
end

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

-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) |
http://codeshooter.wordpress.com/ (en)
7bd5cba5820168467074439c6a03c76b?d=identicon&s=25 Elliott Golden (elliottg)
on 2009-06-07 20:29
(Received via mailing list)
Thanks Maurício.

That worked nicely.

On Jun 5, 11:02 pm, Maurício Linhares <mauricio.linha...@gmail.com>
This topic is locked and can not be replied to.