- master branch is always deployable.
- Cut a new branch off master whenever working on something new.
- When you're ready, either merge the feature branch back into master or make a PR if you want your code reviewed.
- Commit and push often.
- Source code is always open-sourceable (i.e., do not commit API keys, private keys, etc).
- API keys: use environment variables (set them in
.bashrc
or.zshrc
). - Private keys: ignore using
.gitignore
.
- API keys: use environment variables (set them in
- Always write tests. If possible, make the tests as comprehensive as possible. Otherwise, treat them as sanity tests (i.e., to make sure nothing is obviously broken).
- Whenever a bug is discovered, write test for it before fixing it (i.e., practice TDD when shit hits the fan).
- Use only the seven default actions (
index
,new
,create
,show
,edit
,update
,destroy
) in controllers. DHH.
Last active
May 9, 2016 13:58
-
-
Save yihangho/3e130568ed8cb7cfc454d38849a89fd9 to your computer and use it in GitHub Desktop.
Rails Best Practice
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment