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
120
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
490
GIT - Good Practices
wafcio
0
44
Dry System
wafcio
0
82
dry-validations
wafcio
0
130
Validations in Ruby
wafcio
0
98
Generating a CSV file with ROM
wafcio
0
190
Trailblazer bez trailblazera
wafcio
0
140
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
98
Jak (nie) używać Service Object
wafcio
0
120
Other Decks in Programming
See All in Programming
ログラスの継続的なプロンプト改善のためのLLMOpsの今 / LLMOps at loglass now
rkaga
PRO
1
330
『データ可視化学入門』をPythonからRに翻訳した話(増強版)
bob3bob3
0
280
Running Laravel Apps With FrankenPHP
dunglas
4
1.2k
Deep Dive into the Symfony Security Component
hhamon
1
180
孤独のCTOグルメという やや奇抜な企画をやった目的と効果
shoheimitani
3
780
Learning Ruby
okuramasafumi
5
370
ISUCONってなんだか難しそう……!!でも、初めてのISUCONにPHPで挑戦してきました!
kotomin_m
0
260
PHPerKaigi 2024〜10年以上動いているレガシーなバッチシステムを Kubernetes(Amazon EKS) に移行する取り組み〜
tshinowpub
1
170
DDD, necessary but insufficient: physical design principles for microservices
cer
PRO
0
160
Cloud RunとCloud PubSubでサーバレスなデータ基盤2024 with Terraform / Cloud Run and PubSub with Terraform
shinyorke
7
1.7k
Go1.22からの疑似乱数生成器について/go-122-pseudo-random-generator
convto
1
110
phpunit/php-code-coverageって何をしてるんだ #phperkaigi
o0h
PRO
2
190
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
14
1.3k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.1k
Ruby is Unlike a Banana
tanoku
95
10k
Statistics for Hackers
jakevdp
789
220k
Learning to Love Humans: Emotional Interface Design
aarron
266
39k
BBQ
matthewcrist
78
8.7k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
0
3.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
242
12k
Fashionably flexible responsive web design (full day workshop)
malarkey
397
65k
Teambox: Starting and Learning
jrom
126
8.3k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.8k
Thoughts on Productivity
jonyablonski
57
3.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