In general:
- Prefer to commit your
config/*.yml
files, except database.yml (PRIVATE REPOS ONLY!) - Make use of special Rails ANNOTATIONS like
TODO
,FIXME
, andOPTIMIZE
so rake notes can pick it up. - Keep README.md updated (always assume a new team member will join anytime)
CSS and JS:
- Prefer sass-rails as a preprocessor
- Prefer autoprefixer-rails for vendor prefixes
- Prefer haml for templating (via hamlit-rails)
- Prefer bootstrap if a CSS framework is needed
- Prefer bootstrap-sass for Bootstrap + Rails integration
- Prefer rails-assets.org for managing 3rd-party JS/CSS
- Prefer konacha for JS unit testing
Server:
- Prefer puma even in development (for multi-threaded support)
Style Guides:
- Adhere to rsjs when writing JS
Emails:
- Prefer letter_opener for locally testing emails
- Prefer premailer-rails for managing inline email CSS
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.
- Design practices (covers Sass)
- JavaScript practices (covers ES6)
- Testing practices (covers Rspec)
- Git practices (covers Git and GitHub)