# String
class InformationController < BankController
layout "information"
end
# Symbol
class VaultController < BankController
layout :access_level_layout
end
# nil
class CommentsController < ApplicationController
# 始终使用默认的 layout (首先是 comments,然后是 application 的)
layout nil
end
# false
class TillController < BankController
layout false
end
Note: 没有 layout true 这种写法,会报错的。
class ApplicationController < ActionController::Base
layout "application"
end
class PostsController < ApplicationController
# 继承使用 "application" layout
end