-
Notifications
You must be signed in to change notification settings - Fork 277
Home
Robb Shecter edited this page Nov 18, 2015
·
22 revisions
Please go to http://rails-bestpractices.com
How to write your own check list?
Default Check list:
- Move code from Controller to Model
- RESTful Conventions
- 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 ObserverUse Attribute Query
- Controller
Use before_filter-
DRY Controller# not implement, use https://github.com/josevalim/inherited_resources
- View
Move code into controllerMove code into modelMove code into helperReplace instance variable with local variable-
Use Form Builder# not implement, use https://github.com/justinfrench/formtastic -
Organize Helper files# not implement, it’s rails default behaviour
- Deploy