Have all admin namespace controllers extend an Admin controller, which extends ApplicationController. This way you can set the layout and setup role based filters.
On Tue, Oct 6, 2009 at 5:21 PM, m...@samyama <[email protected]> wrote: > > Greetings all, > > I have an application that has both a user front end and an > administrative back end (admin is set up as a namespace in Rails > 2.3.4). I would like to have a different default layout for each > section of the site. > > Currently I am using the layouts/application.html.erb layout for the > whole site. > > How can I tell Rails that when it is in the admin namespace (ie /admin/ > users or /admin/roles) to use a different layout for all controllers > in the admin namespace? I don't want to have to set the layout on each > controller in the admin namespace. > > Thanks in advance, > Mike > > > > > --~--~---------~--~----~------------~-------~--~----~ SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby -~----------~----~----~----~------~----~------~--~---
