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
210
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Slim Ruby on Rails: Controllers & Middlewares
Krzysztof Wawer
June 21, 2017
More Decks by Krzysztof Wawer
See All by Krzysztof Wawer
The Good Architecture
wafcio
0
670
GIT - Good Practices
wafcio
0
110
Dry System
wafcio
0
120
dry-validations
wafcio
0
200
Validations in Ruby
wafcio
0
200
Generating a CSV file with ROM
wafcio
0
370
Trailblazer bez trailblazera
wafcio
0
260
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
210
Jak (nie) używać Service Object
wafcio
0
240
Other Decks in Programming
See All in Programming
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
140
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
200
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.7k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.4k
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
540
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
510
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
Agentic UI
manfredsteyer
PRO
0
160
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
310
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
170
BBQ
matthewcrist
89
10k
Ethics towards AI in product and experience design
skipperchong
2
310
Why Our Code Smells
bkeepers
PRO
340
58k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
The Pragmatic Product Professional
lauravandoore
37
7.3k
Site-Speed That Sticks
csswizardry
13
1.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
RailsConf 2023
tenderlove
30
1.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