rails/README.md
lib for code that is not app-specific and could later be extracted into a gem.app/jobs for code that doesn't need to return anything and can be run asynchronously.rake and
rspec, and add them to version control..ruby-version file convention to specify the Ruby version and patch level for a project.cookies.signed over cookies to prevent tampering.ENV.fetch for environment variables instead of ENV[]so that unset
environment variables are detected on deploy.:except option in routes.member and collection routes.:only option to explicitly state exposed routes._url suffixes for named routes in mailer views and redirects. Use _path suffixes for named routes everywhere else.app/views/application directory.render 'partial' syntax over render partial: 'partial'.link_to for GET requests, and button_to for other HTTP verbs.Guidance on ActiveRecord, ActiveModel, and other model objects.
def self.method, not the scope :method DSL. #643validates :name, presence: true validations, and put all
validations for a given column together. Example.save(validate: false),
update_attribute, and toggle.ActiveModel callbacks, but instead raise an exception.where('inviter_id IS NOT NULL')) outside of models.belongs_to object (user), not the database column (user_id).touch: true when declaring belongs_to relationships._on suffixes._at suffixes.deleted_at, published_at.
This can be valuable when you need to know when something took place. Time for A Boolean provides a nice interface for this._time
suffixes.db/schema.rb or db/development_structure.sql under version control.db/seeds.rb for data that is required in all environments.development:db:seed rake task for development environment seed data. Example.true in production-like environments to avoid accidental writing to the production database.on_delete behavior for foreign keys.main if the desired
change can be solved with another migration.ActiveRecord models, in migrations.Time.current over Time.nowDate.current over Date.todayTime.zone.parse("2014-07-04 16:05:37") over Time.parse("2014-07-04 16:05:37")From header and email in the Reply-To when
delivering email on behalf of the app's users.Follow the normal Code Review guidelines. When reviewing others' Rails work, look in particular for:
ChangeLog or NEWS file.cron) tasks have been added and whether there
is a related todo in the project management system to add it during the
staging and production deploys.