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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Krzysztof Wawer
June 21, 2017
Programming
200
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
660
GIT - Good Practices
wafcio
0
96
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
200
Jak (nie) używać Service Object
wafcio
0
230
Other Decks in Programming
See All in Programming
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
130
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
110
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
250
Feature Toggle は捨てやすく使おう
gennei
0
430
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
3
510
iOS機能開発のAI環境と起きた変化
ryunakayama
0
160
CDK Deployのための ”反響定位”
watany
0
160
事業会社でのセキュリティ長期インターンについて
masachikaura
0
230
KagglerがMixSeekを触ってみた
morim
0
370
見せてもらおうか、 OpenSearchの性能とやらを!
shunta27
1
180
感情を設計する
ichimichi
5
1.3k
AI活用のコスパを最大化する方法
ochtum
0
370
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
450
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
27
3.4k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
210
Believing is Seeing
oripsolob
1
110
The untapped power of vector embeddings
frankvandijk
2
1.7k
Side Projects
sachag
455
43k
エンジニアに許された特別な時間の終わり
watany
106
240k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
100
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
How to build a perfect <img>
jonoalderson
1
5.3k
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