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
160
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
600
GIT - Good Practices
wafcio
0
65
Dry System
wafcio
0
96
dry-validations
wafcio
0
160
Validations in Ruby
wafcio
0
170
Generating a CSV file with ROM
wafcio
0
290
Trailblazer bez trailblazera
wafcio
0
210
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
160
Jak (nie) używać Service Object
wafcio
0
190
Other Decks in Programming
See All in Programming
イベントストーミングから始めるドメイン駆動設計
jgeem
4
790
Rails産でないDBを Railsに引っ越すHACK - Omotesando.rb #110
lnit
1
160
データベースコネクションプール(DBCP)の変遷と理解
fujikawa8
1
220
衛星の軌道をWeb地図上に表示する
sankichi92
0
260
TypeScript LSP の今までとこれから
quramy
1
480
Cloudflare Realtime と Workers でつくるサーバーレス WebRTC
nekoya3
0
370
Effect の双対、Coeffect
yukikurage
4
1.3k
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
130
無関心の谷
kanayannet
0
140
RubyKaigiで得られる10の価値 〜Ruby話を聞くことだけが RubyKaigiじゃない〜
tomohiko9090
0
130
単体テストの始め方/作り方
toms74209200
0
400
社内での開発コミュニティ活動とモジュラーモノリス標準化事例のご紹介/xPalette and Introduction of Modular monolith standardization
m4maruyama
0
110
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Building an army of robots
kneath
306
45k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Bash Introduction
62gerente
614
210k
Faster Mobile Websites
deanohume
307
31k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
42
2.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
Become a Pro
speakerdeck
PRO
28
5.4k
Code Review Best Practice
trishagee
68
18k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Fireside Chat
paigeccino
37
3.5k
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