Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
210
1
Share
Slim Ruby on Rails: Controllers & Middlewares
Krzysztof Wawer
June 21, 2017
More Decks by Krzysztof Wawer
See All by Krzysztof Wawer
The Good Architecture
wafcio
0
670
GIT - Good Practices
wafcio
0
100
Dry System
wafcio
0
120
dry-validations
wafcio
0
190
Validations in Ruby
wafcio
0
200
Generating a CSV file with ROM
wafcio
0
360
Trailblazer bez trailblazera
wafcio
0
250
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
210
Jak (nie) używać Service Object
wafcio
0
240
Other Decks in Programming
See All in Programming
Moments When Things Go Wrong
aurimas
3
120
[BalkanRuby 2026] Drop your app/services!
palkan
3
720
OSもどきOS
arkw
0
270
AIエージェントの隔離技術の徹底比較
kawayu
0
440
さぁV100、メモリをお食べ・・・
nilpe
0
110
Oxlintのカスタムルールの現況
syumai
5
850
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
15
7.2k
Swiftのレキシカルスコープ管理
kntkymt
0
200
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
New "Type" system on PicoRuby
pocke
1
310
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.3k
Inside Stream API
skrb
1
250
Featured
See All Featured
Everyday Curiosity
cassininazir
0
210
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
140
Balancing Empowerment & Direction
lara
6
1.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
エンジニアに許された特別な時間の終わり
watany
107
240k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
GraphQLとの向き合い方2022年版
quramy
50
15k
The browser strikes back
jonoalderson
0
1.1k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
120
WENDY [Excerpt]
tessaabrams
11
38k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
sira's awesome portfolio website redesign presentation
elsirapls
0
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