In my controller I’m using layout 'application', :only => :edit
But I noticed that layout 'application', :for => :edit works as well.
Just curious because docs only mention :only & :except. I can’t explicitly find :for in any docs for the layout method.
As I commented above, Rails is ignoring your :for parameter and should just be using the ‘application’ layout for all actions.
As far as rendering multiple layouts, it seems you can only have a single
layout ...line for your controller; if you have multiples, it will only use the last one. And if the last one has an:onlyor:exceptparameter, it should fall back to theapplicationlayout for all the other actions. If it’s not properly using theapplicationlayout and rendering without any layout whatsoever, make sure the previous developer didn’t put something likelayout nilsomewhere in your controller/application.If you want to handle multiple layouts inside your controller, you could also try this: