Le Wagon — 4 Tips and Tricks for Project Week Your TAs Don’t Want You to Know About 🙊

Shorter git commands

  • ggpush ==git push origin <branch-name>
  • ggpull ==git pull origin <branch-name>
  • gco == git checkout
  • gc -am "message" == git add . + git commit -m "message" (DISCLAIMER: it will work only on modified files, not newly created ones)
  • and finally gst == git status (though I personally prefer git st as the output is more concise)
All that saved time on typing!

Reset IDs when re-running seeds

  1. Add gem 'database_cleaner-active_record' to your Gemfile
  2. Run bundle install
  3. At the very beginning of your db/seeds.rb add the following lines:
require 'database_cleaner/active_record'DatabaseCleaner.allow_production = true                             DatabaseCleaner.allow_remote_database_url = true                             DatabaseCleaner.strategy = :truncation                             DatabaseCleaner.clean# write your seeds below this line

Automatically deploy to Heroku

The power of automation, now delivered directly to your application.
  1. Go to your app’s dashboard on Heroku (url should be something like https://dashboard.heroku.com/apps/app-name )
  2. Click on Deploy (https://dashboard.heroku.com/apps/app-name/deploy/heroku-git)
  3. In Deployment Method select GitHub (https://dashboard.heroku.com/apps/app-name/deploy/github)
  4. Enable Heroku extension on GitHub
  5. Search for the repository you want to connect to and click Connect
  6. Select deployment branch (master or main)
  7. Enable Automatic Deploys (no need to tick “Wait for CI to pass before deploy”)

Display Rails error page on Heroku

Yes, I know that something went wrong, thank you very much. Would you be so kind and tell me what did?

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store