$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
80
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
AWS CDKの推しポイントN選
akihisaikeda
1
240
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
150
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
ゲームの物理 剛体編
fadis
0
330
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
150
Integrating WordPress and Symfony
alexandresalome
0
150
FluorTracer / RayTracingCamp11
kugimasa
0
230
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
390
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
500
AIコーディングエージェント(Manus)
kondai24
0
170
tparseでgo testの出力を見やすくする
utgwkk
1
210
関数実行の裏側では何が起きているのか?
minop1205
1
690
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.4k
How STYLIGHT went responsive
nonsquared
100
6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Six Lessons from altMBA
skipperchong
29
4.1k
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