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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Krzysztof Wawer
June 21, 2017
Programming
1
200
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
650
GIT - Good Practices
wafcio
0
94
Dry System
wafcio
0
120
dry-validations
wafcio
0
190
Validations in Ruby
wafcio
0
200
Generating a CSV file with ROM
wafcio
0
350
Trailblazer bez trailblazera
wafcio
0
240
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
200
Jak (nie) używać Service Object
wafcio
0
230
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
350
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
230
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
460
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
230
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
0
210
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
13
7.7k
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
8
2.4k
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
220
登壇資料を作る時に意識していること #登壇資料_findy
konifar
5
2.1k
CopilotKit + AG-UIを学ぶ
nearme_tech
PRO
1
120
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
200
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Exploring anti-patterns in Rails
aemeredith
2
280
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Abbi's Birthday
coloredviolet
2
5.1k
Marketing to machines
jonoalderson
1
5k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
140
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
130
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
340
Utilizing Notion as your number one productivity tool
mfonobong
4
240
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.4k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
270
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
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