$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
81
Dry System
wafcio
0
110
dry-validations
wafcio
0
180
Validations in Ruby
wafcio
0
190
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
1
280
これならできる!個人開発のすゝめ
tinykitten
PRO
0
110
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
AIコーディングエージェント(NotebookLM)
kondai24
0
200
Cell-Based Architecture
larchanjo
0
130
関数実行の裏側では何が起きているのか?
minop1205
1
710
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
740
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
350
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
430
GISエンジニアから見たLINKSデータ
nokonoko1203
0
130
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.5k
WebRTC と Rust と8K 60fps
tnoho
2
2k
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.1k
Thoughts on Productivity
jonyablonski
73
5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
How GitHub (no longer) Works
holman
316
140k
Become a Pro
speakerdeck
PRO
31
5.7k
How STYLIGHT went responsive
nonsquared
100
6k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
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