bbatsov/rails-style-guide: A community-driven Ruby on Rails 4 style guide - 0 views
-
custom initialization code in config/initializers. The code in initializers executes on application startup
- ...90 more annotations...
-
Don't use match to define any routes unless there is need to map multiple request types among [:get, :post, :patch, :put, :delete] to a single action using :via option.
-
Use the friendly_id gem. It allows creation of human-readable URLs by using some descriptive attribute of the model instead of its id
-
Looping through a collection of records from the database (using the all method, for example) is very inefficient since it will try to instantiate all the objects at once
-
use models in migrations, make sure you define them so that you don't end up with broken migrations in the future
-
Never make complex formatting in the views, export the formatting to a method in the view helper or the model.
-
config/application.rb config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
-
Sending emails while generating page response should be avoided. It causes delays in loading of the page and request can timeout if multiple email are sent.
-
Add all OS X specific gems to a darwin group in the Gemfile, and all Linux specific gems to a linux group