-
Notifications
You must be signed in to change notification settings - Fork 277
Home
flyerhzm edited this page Aug 13, 2010
·
22 revisions
Please go to http://rails-bestpractices.com
- Lesson 1. Move code from Controller to Model
- Lesson 2. RESTful Conventions
- Lesson 3. Model
Keep Finders on Their Own Model-
Love named_scope# same as Move finder to named_scope the Law of Demeter- DRY: metaprogramming
- Extract into Module
- Extract to composed class
Use Observer
- Lesson 4. Migration
- Lesson 5. Controller
Use before_filter-
DRY Controller# not implement, use http://github.com/josevalim/inherited_resources
- Lesson 6. View
Move code into controllerMove code into modelMove code into helperReplace instance variable with local variable-
Use Form Builder# not implement, use http://github.com/justinfrench/formtastic -
Organize Helper files# not implement, it’s rails default behaviour