$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Slim Ruby on Rails: Controllers & Middlewares
Search
Krzysztof Wawer
June 21, 2017
Programming
1
180
Slim Ruby on Rails: Controllers & Middlewares
Krzysztof Wawer
June 21, 2017
Tweet
Share
More Decks by Krzysztof Wawer
See All by Krzysztof Wawer
The Good Architecture
wafcio
0
640
GIT - Good Practices
wafcio
0
82
Dry System
wafcio
0
110
dry-validations
wafcio
0
180
Validations in Ruby
wafcio
0
200
Generating a CSV file with ROM
wafcio
0
330
Trailblazer bez trailblazera
wafcio
0
230
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
190
Jak (nie) używać Service Object
wafcio
0
220
Other Decks in Programming
See All in Programming
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
360
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
180
Deno Tunnel を使ってみた話
kamekyame
0
220
エディターってAIで操作できるんだぜ
kis9a
0
750
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.3k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
250
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.7k
TestingOsaka6_Ozono
o3
0
170
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
120
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
400
認証・認可の基本を学ぼう前編
kouyuume
0
260
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
23
The SEO identity crisis: Don't let AI make you average
varn
0
34
Documentation Writing (for coders)
carmenintech
77
5.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Accessibility Awareness
sabderemane
0
22
Rails Girls Zürich Keynote
gr2m
95
14k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
0
130
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Building the Perfect Custom Keyboard
takai
1
660
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.4k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
260
Transcript
Slim Ruby on Rails: Controllers & Middlewares Krzysztof Wawer
Request https://medium.com/@christemple/what-is-rack-in-ruby-7e0615f1d9b6
Request Rack App Middlewares log auth cache HTTP Request HTTP
Response
Middleware
Rack Middleware http://railscasts.com/episodes/151-rack-middleware
Ruby on Rails Middleware stack $ rails new app $
rails new app --api $ rake middleware http://guides.rubyonrails.org/rails_on_rack.html#configuring-middleware-stack
Ruby on Rails Middleware stack use Rack::MethodOverride use Sprockets::Rails::QuietAssets use
WebConsole::Middleware use ActionDispatch::Cookies use ActionDispatch::Session::CookieStore use ActionDispatch::Flash http://guides.rubyonrails.org/rails_on_rack.html#configuring-middleware-stack
RoR Middlewares problem https://github.com/rails/rails/blob/master/railties/lib/rails/application/default_middleware_stack.rb
http://paulserraino.com/rails/2016/02/29/rails-mountable-engines.html Rails Engines
Ruby on Rails Engine http://tech.taskrabbit.com/blog/2014/02/11/rails-4-engines/
Controller
None
None
ActionController::Base http://api.rubyonrails.org/classes/ActionController/Base.html
ActionController::API http://api.rubyonrails.org/classes/ActionController/API.html
ActionController::Metal http://api.rubyonrails.org/classes/ActionController/Metal.html
ActionController::API http://api.rubyonrails.org/classes/ActionController/API.html
Why ?
• Strong Parameters • Params Wrapper
• Strong Parameters • Params Wrapper Mapping
Mapping - missing part Nested Attributes - revealing structure