Rails Best Practices
View more presentations from Wen-Tien Chang
Here are my favorites slides numbers
- #13 – Move finders to named scope
- #15 – Use model accociation
- #17 – Use scope access
- #19 – Add model virtual attributes
- #22 – Use model callback
- #25 – Replace complex creation with factory method
- #28 – Move model logic to model..absolutely
- #34 – Nested model forms
- #42 – Organize controllers/actions in a RESTful way
- #44 – Overuse route customizations
- #49 – Avoid needless deep nesting
- #54 – Keep finders in their own model
- #56 – Make neat use of named scope
- #61 – DRY: Metaprogramming
- #64 – Create modules for better reusability
- #69 – User observer
- #75 – Always add DB index especially on referenced columns
- #78 – Use filters and DRY
- #80 – DRY controller using Inherited Resources
- #86 – Avoid conding logic in Views. Move as much code to controller, helper or model based on the nature of the code
- #89 – Replace instances variables with locals in partials.