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
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
440
横断組織出身のQAEがインプロセスQAEでつまずいたこと・活かせたこと
ty89
0
450
iOS26時代の新規アプリ開発
yuukiw00w
0
210
Sans tests, vos agents ne sont pas fiables
nabondance
0
170
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
2.9k
3Dシーンの圧縮
fadis
1
460
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
140
AI Agent と正しく分析するための環境作り
yoshyum
3
630
色即是空、空即是色、データサイエンス
kamoneggi
1
200
バックエンドにElysiaJSを採用して気付いた、良い点・悪い点
wanko_it
1
190
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
130
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
280
Featured
See All Featured
From π to Pie charts
rasagy
0
190
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
280
Skip the Path - Find Your Career Trail
mkilby
1
130
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Prompt Engineering for Job Search
mfonobong
0
320
Building an army of robots
kneath
306
46k
Believing is Seeing
oripsolob
1
130
The Spectacular Lies of Maps
axbom
PRO
1
770
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
390
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
180
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
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