ActionController::Base::MODULES
MODULES = [
AbstractController::Rendering,
AbstractController::Translation,
AbstractController::AssetPaths,
Helpers,
UrlFor,
Redirecting,
ActionView::Layouts,
Rendering,
Renderers::All,
ConditionalGet,
EtagWithTemplateDigest,
RackDelegation,
Caching,
MimeResponds,
ImplicitRender,
StrongParameters,
Cookies,
Flash,
RequestForgeryProtection,
ForceSSL,
Streaming,
DataStreaming,
HttpAuthentication::Basic::ControllerMethods,
HttpAuthentication::Digest::ControllerMethods,
HttpAuthentication::Token::ControllerMethods,
AbstractController::Callbacks,
Rescue,
Instrumentation,
ParamsWrapper
]
MODULES.each do |mod|
include mod
end
后文讲到的【API】是精简版的 Base,它也是直接继承于 Metal,在 API 模式里可用。