Sha256: 6935be0fed78dc1d788204380387c43fe03eee0ed8e683d3c0f17b736f444ca3
Contents?: true
Size: 1.76 KB
Versions: 1
Compression:
Stored size: 1.76 KB
Contents
h1. rails_best_practices rails_best_practices is a gem to check quality of rails app files according to ihower's presentation "Rails Best Practices":http://www.slideshare.net/ihower/rails-best-practices. rails_best_practices is a static file parser tool based on ruby_parser. ************************************************* h2. Install <pre><code> sudo gem install rails_best_practices --source http://gemcutter.org </code></pre> ************************************************* h2. Usage at the root of rails <pre><code> rails_best_practices . </code></pre> ************************************************* h2. Progress * Lesson 1. Move code from Controller to Model ## [-Move finder to named_scope-] ## [-Use model association-] ## [-Use scope access-] ## [-Add model virtual attribute-] ## Use model callback ## [-Replace Complex Creation with Factory Method-] ## [-Move Model Logic into the Model-] ## model.collection_model_ids (many-to-many) ## Nested Model Forms (one-to-one) ## Nested Model Forms (one-to-many) * Lesson 2. RESTful Conventions ## [-Overuse route customizations-] ## Needless deep nesting ## Not use default route * Lesson 3. Model ## Keep Finders on Their Own Model ## Love named_scope ## the Law of Demeter ## DRY: metaprogramming ## Extract into Module ## Extract to composed class ## Use Observer * Lesson 4. Migration ## Isolating Seed Data ## Always add DB index * Lesson 5. Controller ## Use before_filter ## DRY Controller * Lesson 6. View ## Move code into controller ## Move code into model ## Move code into helper ## Replace instance variable with local variable ## Use Form Builder ## Organize Helper files ************************************************* Copyright © 2009 Richard Huang (flyerhzm@gmail.com), released under the MIT license
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_best_practices-0.1.2 | README.textile |