Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rails Maintainance Headaches
Search
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
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
580
マスタデータ問題、マイクロサービスでどう解くか
kts
0
130
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
130
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.3k
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
420
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
140
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
1.8k
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
120
Basic Architectures
denyspoltorak
0
120
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
970
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
110
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.4k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
250
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
1
210
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Leo the Paperboy
mayatellez
0
1.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Facilitating Awesome Meetings
lara
57
6.7k
Ethics towards AI in product and experience design
skipperchong
1
140
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