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
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
630
GIT - Good Practices
wafcio
0
78
Dry System
wafcio
0
110
dry-validations
wafcio
0
180
Validations in Ruby
wafcio
0
190
Generating a CSV file with ROM
wafcio
0
320
Trailblazer bez trailblazera
wafcio
0
230
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
180
Jak (nie) używać Service Object
wafcio
0
210
Other Decks in Programming
See All in Programming
イベントストーミングのはじめかた / Getting Started with Event Storming
nrslib
1
610
カンファレンス遠征を(安く)楽しむ技術
wp_daisuke
0
170
早すぎ?超先読み Go 1.26 Draft - Preview the contents of the Go 1.26 Draft Release Notes
tomtwinkle
0
330
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
130
Building AI with AI
inesmontani
PRO
0
210
Web エンジニアが JavaScript で AI Agent を作る / JSConf JP 2025 sponsor session
izumin5210
4
1.8k
AI駆動開発ライフサイクル(AI-DLC)のホワイトペーパーを解説
swxhariu5
0
1.1k
高単価案件で働くための心構え
nullnull
0
150
CloudflareのSandbox SDKを試してみた
syumai
0
170
Vueで学ぶデータ構造入門 リンクリストとキューでリアクティビティを捉える / Vue Data Structures: Linked Lists and Queues for Reactivity
konkarin
1
310
「正規表現をつくる」をつくる / make "make regex"
makenowjust
1
640
JEP 496 と JEP 497 から学ぶ耐量子計算機暗号入門 / Learning Post-Quantum Crypto Basics from JEP 496 & 497
mackey0225
2
400
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
5.9k
Why Our Code Smells
bkeepers
PRO
340
57k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
How to train your dragon (web standard)
notwaldorf
97
6.4k
How GitHub (no longer) Works
holman
315
140k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Building Applications with DynamoDB
mza
96
6.8k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
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