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
500
GIT - Good Practices
wafcio
0
45
Dry System
wafcio
0
82
dry-validations
wafcio
0
130
Validations in Ruby
wafcio
0
100
Generating a CSV file with ROM
wafcio
0
200
Trailblazer bez trailblazera
wafcio
0
140
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
100
Jak (nie) używać Service Object
wafcio
0
130
Other Decks in Programming
See All in Programming
Elm 0.19.0 Changes
bkuhlmann
0
490
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.3k
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
코틀린으로 멀티플랫폼 만들기
pangmoo
0
140
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
480
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
4k
VS Code をプロダクトにどう取り込むか
onomax
1
350
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
6
900
エンターテイメント業界で利用されるAWS
demuyan
0
210
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
100
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
810
今、知っておきたい! 生成AIエージェントの世界
elith
3
350
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
43
9.7k
Debugging Ruby Performance
tmm1
70
11k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
36
2.5k
Side Projects
sachag
451
41k
The Illustrated Children's Guide to Kubernetes
chrisshort
30
46k
The Mythical Team-Month
searls
215
42k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.4k
A Philosophy of Restraint
colly
196
16k
Building Applications with DynamoDB
mza
88
5.6k
Building Effective Engineering Teams - LeadDev
addyosmani
28
1.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.4k
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