Skip to content

Instantly share code, notes, and snippets.

@totem3
Last active June 13, 2017 05:19
Show Gist options
  • Save totem3/c9502d321eda5e06af6db2b530c0db7e to your computer and use it in GitHub Desktop.
Save totem3/c9502d321eda5e06af6db2b530c0db7e 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
* 普段何気なく使っているRailsのControllerの便利な機能を何も提供しない最低限のController
* 多分ベアメタル的な意味合いでMetal?
* [http://weblog.rubyonrails.org/2008/12/17/introducing-rails-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](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