Skip to content

Instantly share code, notes, and snippets.

@Godoy
Last active June 16, 2020 17:44
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Godoy/4538424 to your computer and use it in GitHub Desktop.
Save Godoy/4538424 to your computer and use it in GitHub Desktop.
Desfazendo coisas no Rails
$ rails generate controller Noticias titulo
$ rails destroy controller Noticias titulo
$ rails generate model Noticia titulo:string
$ rails destroy model Noticia
$ rake db:migrate
$ rake db:rollback
$ rake db:migrate VERSION=0 #defaz todas as migrations, deixa o banco "limpo"
$ rake db:migrate:reset #reseta todo o banco, perdendo todos os registros, e já executa novamente as todas as migrations
$ bundle exec rake assets:clobber(Removes all compiled assets)
$ bundle exec rake assets:precompile (Precompiled assets again)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment