Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 3.46 KB

rails.md

File metadata and controls

62 lines (44 loc) · 3.46 KB

Rails

In general:

  • Prefer to commit your config/*.yml files, except database.yml (PRIVATE REPOS ONLY!)
  • Make use of special Rails ANNOTATIONS like TODO, FIXME, and OPTIMIZE so rake notes can pick it up.
  • Keep README.md updated (always assume a new team member will join anytime)

CSS and JS:

Server:

  • Prefer puma even in development (for multi-threaded support)

Style Guides:

  • Adhere to rsjs when writing JS

Emails:

Rake tasks:

  • Ensure db:migrate runs properly
  • Ensure db:rollback runs properly
  • Ensure db:seed runs properly (They get outdated fast!). Alternatively, provide a way to seed a newcomer's project.
  • Ensure painless turnovers

Configuration:

  • Use config/secrets.yml to store config
  • Use 12-factor style when overrides are needed: pusher_id: <%= ENV['PUSHER_ID'] || '...' %>
  • Access them in your app via Rails.application.secrets.pusher_id

Avoid:

  • Avoid less-rails. Slow to update, and doesn't support import globbing
  • Avoid compass unless necessary. Use autoprefixer instead
  • Avoid bootstrap-on-rails because it's .less and not currently maintained
  • Avoid twitter-bootstrap-rails because it's .less and has too many abstractions
  • Avoid coffeescript. Prefer to use sprockets-es6 instead. (article)
  • Avoid bower-rails. Heroku setup can be a pain, and rails-assets is a better choice nowadays.
  • Avoid configuration gems like figaro, dotenv, etc. Rails 4.1 should render them useless now.
  • Avoid teaspoon. It has more boilerplate to setup, and doesn't sandbox your test DOM unlike konacha. Use konacha instead
  • Avoid Enums. They can cause non-obvious problems with queries (1, 2, 3). Use strings instead.

Also see