Skip to content

Instantly share code, notes, and snippets.

@totem3
Created June 13, 2017 05:20
Show Gist options
  • Save totem3/d9d4d6ab806236a5f3f484e2dd70e0ad to your computer and use it in GitHub Desktop.
Save totem3/d9d4d6ab806236a5f3f484e2dd70e0ad to your computer and use it in GitHub Desktop.

!SLIDE

今日のお題

ActionController

!SLIDE

  • ActionDispatch が dispatch する先
  • MVC の まさに C(まさに)

!SLIDE

継承関係

ActionController::Base ← ActionController::Metal ← AbstractConroller::Base

!SLIDE

AbstractConroller::Base

  • 低レベルなAPIを提供するクラス
  • controllerの名前やファイルパスを見つけるとか
  • actionをdispatchするためのメソッドとか

!SLIDE

Metal

!SLIDE

Metalは何に使うのか

Think of Rails Metal as a subset of middleware intended for application-specific end points that need the extra speed (“write to the metal”, hence the name). スピードが必要なとき

render も存在しない

https://gist.githubusercontent.com/totem3/c9502d321eda5e06af6db2b530c0db7e/raw/8118fb9d1063e7c4d661f7875b8d901e35f26884/metal_error.png

!SLIDE

ActionController::Base

AbstractController::Rendering AbstractController::Translation AbstractController::AssetPaths Helpers UrlFor Redirecting ActionView::Layouts Rendering Renderers::All ConditionalGet EtagWithTemplateDigest Caching MimeResponds ImplicitRender StrongParameters Cookies Flash FormBuilder RequestForgeryProtection ForceSSL Streaming DataStreaming HttpAuthentication::Basic::ControllerMethods HttpAuthentication::Digest::ControllerMethods HttpAuthentication::Token::ControllerMethods AbstractController::Callbacks Rescue Instrumentation ParamsWrapper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment