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
Rails Maintainance Headaches
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
pete higgins
July 03, 2013
Programming
0
140
Rails Maintainance Headaches
pete higgins
July 03, 2013
Tweet
Share
More Decks by pete higgins
See All by pete higgins
Help Seattle.rb
phiggins
0
90
Rails Archeology
phiggins
2
130
Webmock
phiggins
0
78
Ruby Stdlib's Benchmark
phiggins
0
68
Hacking Ruby
phiggins
3
220
Lightweight Objects Seattle.rb
phiggins
1
84
Cute Animals You've Never Heard Of
phiggins
0
480
Other Decks in Programming
See All in Programming
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
190
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
150
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
160
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
560
へんな働き方
yusukebe
0
260
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
280
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
610
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
210
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8.1k
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
420
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
5
1k
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
170
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
96
14k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
480
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
200
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
150
Practical Orchestrator
shlominoach
191
11k
30 Presentation Tips
portentint
PRO
1
250
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
SEO for Brand Visibility & Recognition
aleyda
0
4.4k
Claude Code のすすめ
schroneko
67
220k
Transcript
Rails Bad Practices Pete Higgins Seattle.rb
Me twitter: @pete_higgins github: @phiggins
Not me
Not me
Me
Me
“Why should I listen to you?”
What this isn't * An excuse to bash Rails *
Performance optimization * Comprehensive
What this isn't * An excuse to bash Rails *
Performance optimization
What this isn't * An excuse to bash Rails *
Performance optimization * A comprehensive list
Comprehensive * I am not a ZOMG Expert
Comprehensive * I am not a ZOMG Expert * “Do
these things and your code is fixed”
“Then what is this about?”
DHH Inventor of Rails and race cars. Original screencast: http://rubyonrails.ytmnd.com/
High level things I am obligated to mention
Comments
Cleverness Widget. where(foo_id:id). pluck(:timestamp). map(&:to_i). reduce(:-). abs
Debugging this ¯\_( ツ )_/¯
Cleverness Widget. where(foo_id:id). pluck(:timestamp). map(&:to_i). reduce(:-). abs
Resources are database models
Resources are not necessarily database models
Resources resource :profile, only: [:edit, :update] do member do get
'photo' => 'profile#edit_photo' post 'photo' => 'profile#update_photo' get 'crop_photo' end end
Resources resource :photo, only: [:edit, :create] resource :profile, only: [:edit,
:update]
Resources
Resources
Resources * Do one thing in controller / actions.
Cleverness * ActiveRecord callbacks. * Observers.
Resources * Do one thing in controller / actions. *
Delegate to other objects.
Models * Service Objects, Factories, Builders, non-ActiveRecord models.
Remove logic from views * Use view objects, presenters, form
objects, decorators, etc.
Use Ruby * What you call it isn't important. *
Not everything has to be a controller, model, helper or view.
Avoid @ivars def page @page ||= params[:page] || 1 end
private :page helper_method :page
Avoid @ivars def page @page ||= params[:page] || 1 end
private :page helper_method :page * rubygems.org/gems/ decent_exposure
None
Questions? twitter: @pete_higgins github: @phiggins