Skip to content

Instantly share code, notes, and snippets.

@spielhoelle
Last active October 12, 2017 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spielhoelle/a33bdd2a3067f0ecc790de6449e48349 to your computer and use it in GitHub Desktop.
Save spielhoelle/a33bdd2a3067f0ecc790de6449e48349 to your computer and use it in GitHub Desktop.
# Sometimes you need to prepend (bundle exec)
# eg:
# bundle exec rails server
rails -T (show tasks)
rails server (starts server)
rails console (starts console)
rails db:migrate (runns migration - will just work one way. You can rollback one step and run it again)
rails db:rollback (rollback last migration, 1 step)
rails haml:erb2haml (convert initial .erb extensions to haml)
bundle install (if you changed the gemfile and want to install your current setup)
rvm use 2.4.1 (switch ruby version to 2.4.1)
rails generate controller Welcome (generates controller, set route and create lot of clutter)
rails generate model Post (creates more than the controller generator. Model, controller, view, routes, test etc.)
# see more at http://guides.rubyonrails.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment