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
130
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
550
GIT - Good Practices
wafcio
0
49
Dry System
wafcio
0
89
dry-validations
wafcio
0
140
Validations in Ruby
wafcio
0
150
Generating a CSV file with ROM
wafcio
0
250
Trailblazer bez trailblazera
wafcio
0
180
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
120
Jak (nie) używać Service Object
wafcio
0
160
Other Decks in Programming
See All in Programming
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
talk-with-local-llm-with-web-streams-api
kbaba1001
0
170
Full stack testing :: basic to basic
up1
1
930
快速入門可觀測性
blueswen
0
310
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
3
920
From Translations to Multi Dimension Entities
alexanderschranz
2
130
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
190
CSC305 Lecture 26
javiergs
PRO
0
140
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
620
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
Haze - Real time background blurring
chrisbanes
1
500
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
45
7k
Visualization
eitanlees
146
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
510
A Philosophy of Restraint
colly
203
16k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Bash Introduction
62gerente
608
210k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Statistics for Hackers
jakevdp
796
220k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
The World Runs on Bad Software
bkeepers
PRO
65
11k
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