Archive for August, 2008
Ruby on Rails Development Tips

Image Source: www.web2.socialcomputingmagazine.com
Ruby on Rails is great for acquiring ideas prototyped super quick. These tips will slow down growth and make apps less portable, but definitely progress the speed your system
Ruby on rails coding style:
• Try to evade the over indulgence use of helpers since it adds overhead.
• You may think about using memcached to cache your model and library computation results.
• Use a custom configuration file for passwords and API keys instead of keeping them in your Subversion repository. Use YAML and mirror the style of database.yml.
• Use constants when desired. Instead of repeating strings like the address of your customer service reply email, set it once in a constant (in environment.rb or the appropriate environment file) and use that throughout your application.
• Keep time in UTC. A no brainer, and easy to do.
• Don’t loop through ActiveRecord models inside other models. Use keen loading if you need to exertion with multiple associated models. Better yet, write a custom SQL query and let the database do the work for you.