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
150
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
580
GIT - Good Practices
wafcio
0
59
Dry System
wafcio
0
90
dry-validations
wafcio
0
150
Validations in Ruby
wafcio
0
160
Generating a CSV file with ROM
wafcio
0
280
Trailblazer bez trailblazera
wafcio
0
200
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
150
Jak (nie) używać Service Object
wafcio
0
180
Other Decks in Programming
See All in Programming
Develop Faster With FrankenPHP
dunglas
2
3.1k
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
670
custom_lintで始めるチームルール管理
akaboshinit
0
200
AI Agents with JavaScript
slobodan
0
200
SEAL - Dive into the sea of search engines - Symfony Live Berlin 2025
alexanderschranz
1
110
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
890
Go1.24 go vetとtestsアナライザ
kuro_kurorrr
2
800
Windows版PHPのビルド手順とPHP 8.4における変更点
matsuo_atsushi
0
400
SQL Server ベクトル検索
odashinsuke
0
160
Do Dumb Things
mitsuhiko
0
400
ミリしらMCP勉強会
watany
4
710
AtCoder Heuristic First-step Vol.1 講義スライド(山登り法・焼きなまし法編)
takumi152
4
1k
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.6k
GraphQLとの向き合い方2022年版
quramy
45
14k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Gamification - CAS2011
davidbonilla
81
5.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
31
4.8k
Making Projects Easy
brettharned
116
6.1k
Testing 201, or: Great Expectations
jmmastey
42
7.4k
Optimizing for Happiness
mojombo
377
70k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
30
1.1k
Into the Great Unknown - MozCon
thekraken
36
1.7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
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