ActionController::API と ActionController::Base の比較
概要
API ではすべての機能がどのような制限を受けているのか、また API の代わりに Base を使用した場合に速度に違いがあるのかを知りたいです。
これら 2 つのモジュールの違いを見つけるために多くの場所を検索しましたが、API が Base の軽量バージョンであることだけを知ることができました。
解決策
両方の違いを理解するための最良の情報源は、ソース コードに含まれるモジュールのリストです。
これらのモジュールが含まれる ActionController::Base はどれですか (コメントは削除され、アルファベット順に並べ替えられています)。
MODULES = [
AbstractController::AssetPaths,
AbstractController::Callbacks,
AbstractController::Rendering,
AbstractController::Translation,
ActionView::Layouts,
Caching,
ConditionalGet,
ContentSecurityPolicy,
Cookies,
DataStreaming,
DefaultHeaders,
EtagWithFlash,
EtagWithTemplateDigest,
Flash,
FormBuilder,
Helpers,
HttpAuthentication::Basic::ControllerMethods,
HttpAuthentication::Digest::ControllerMethods,
HttpAuthentication::Token::ControllerMethods,
ImplicitRender,
Instrumentation,
Logging,
MimeResponds,
ParameterEncoding,
ParamsWrapper,
PermissionsPolicy,
Redirecting,
Renderers::All,
Rendering,
RequestForgeryProtection,
Rescue,
Streaming,
StrongParameters,
UrlFor,
]
ActionController::API にはこれらのみが含まれています (ここでも、コメントは削除され、アルファベット順に並べ替えられています)。
MODULES = [
AbstractController::Callbacks,
AbstractController::Rendering,
ApiRendering,
BasicImplicitRender,
ConditionalGet,
DataStreaming,
DefaultHeaders,
Instrumentation,
Logging,
ParamsWrapper,
Redirecting,
Renderers::All,
Rescue,
StrongParameters,
UrlFor,
]