This was valid for ancient Rails versions. It won't work on current Railses.
This returns the name (including path) of your current layout:
response.layout
=> "layouts/admin" # inside views that are using the 'admin' layout
You most likely do not need the full path, so go ahead and do this:
File.basename(response.layout)
=> "admin"
Posted by Arne Hartherz to makandra dev (2010-10-27 08:06)