In my understanding, I can specify the layout for the controller by setting
layout 'mylayout'
in the controller file. I also understand that I can specify certain actions for which the layout will be called using :onlyand :exceptas such: layout 'mylayout' ,: only => [: index ,: new] or layout 'mylayout' ,: except => [: index ,: new]
What interests me is, can I put layout 'mylayout'applications in my controller and specify what will be displayed only for certain controllers with something like :only_controllerand :except_controller, or do I need to specify layout 'mylayout'in each controller I want it to be displayed?
The reason for this is that I have several controllers that are responsible for the admin section of my site, and I would like to have a different layout for them.
source
share