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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
88
Rails Archeology
phiggins
2
120
Webmock
phiggins
0
76
Ruby Stdlib's Benchmark
phiggins
0
67
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
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.3k
AI & Enginnering
codelynx
0
110
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
260
CSC307 Lecture 04
javiergs
PRO
0
660
CSC307 Lecture 07
javiergs
PRO
0
550
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
dchart: charts from deck markup
ajstarks
3
990
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
CSC307 Lecture 02
javiergs
PRO
1
780
Basic Architectures
denyspoltorak
0
670
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
47
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
180
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Making Projects Easy
brettharned
120
6.6k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
110
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
99
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