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
120
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
520
GIT - Good Practices
wafcio
0
45
Dry System
wafcio
0
85
dry-validations
wafcio
0
140
Validations in Ruby
wafcio
0
120
Generating a CSV file with ROM
wafcio
0
220
Trailblazer bez trailblazera
wafcio
0
150
ActiveRecord, DataMapper czy Agregacja encji
wafcio
0
110
Jak (nie) używać Service Object
wafcio
0
140
Other Decks in Programming
See All in Programming
AWS初心者ってどうやってAWSを学ぶ?〜アプリエンジニアがやってよかったアーキテクチャ学習方法〜
yamanashi_ren01
0
190
SRE チーム立ち上げ前に考えたこと・取り組んだこと / Considerations and Preparations Before Establishing an SRE Team
mackey0225
3
320
【Go言語】golangci-lintの使い方
tomo1227
0
280
Polarsの成長: v0.14からv1.0までの変遷と今後の展望
zerebom
1
350
英語
s_shimotori
1
220
開発部に不満を持っていたCSがエンジニアにジョブチェンしてわかった「勝手に諦めない」ことの大切さ
sakuraikotone
28
16k
12年前の『型システム入門』翻訳の思い出話
mame
11
1.2k
Prompt FlowによるLLMアプリケーション開発
yuto2000
1
1k
Javaの現状2024夏 / Java current status 2024 summer
kishida
4
1.4k
最近追加した型の紹介とその振り返り
aki19035vc
0
180
「2024年版 Kotlin サーバーサイドプログラミング実践開発」の補講 〜O/Rマッパー編〜
n_takehata
2
260
3 Effective Rules for Success with Signals in Angular
manfredsteyer
PRO
0
120
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
34
1.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.3k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
Raft: Consensus for Rubyists
vanstee
134
6.5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
44
4.7k
How to train your dragon (web standard)
notwaldorf
79
5.5k
Making the Leap to Tech Lead
cromwellryan
127
8.7k
Thoughts on Productivity
jonyablonski
64
4.1k
WebSockets: Embracing the real-time Web
robhawkes
59
7.2k
Building Applications with DynamoDB
mza
89
5.8k
It's Worth the Effort
3n
181
27k
Designing Experiences People Love
moore
136
23k
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