I want to delete all the files it created and roll back any changes made, but not necessarily to the database, but more to the config files.
I\'d like to automatical
rails destroy controller lalala
rails destroy model yadayada
rails destroy scaffold hohoho
Rails 3.2 adds a new d
shortcut to the command, so now you can write:
rails d controller lalala
rails d model yadayada
rails d scaffold hohoho
If you use Rails, use rails d controller Users
.
And, if you use Zeus, use zeus d controller Users
.
On the other hand, if you are using git or SVN, revert your changes with the commit number. This is much faster.
All versions of rails have a "destroy", so-, if you create a (for example) scaffold named "tasks" using a generator, to destroy all the changes of that generate step you will have to type:
rails destroy scaffold Tasks
Hope it helps you.
To reverse that, we just destroy it. Open the Terminal application and go to the project directory, then, type this:
rails destroy model CamelCase
rails destroy controller CamelCase
Where CamelCase
is a name of any model or controller.
It will remove the model, migration and some of the related test files. (You can see the result in the Terminal window after you have run the command.)
To reverse rails generate
, use rails destroy
:
rails destroy Model
See "rails destroy" for more information.
rails destroy controller Controller_name
was returning a bunch of errors. To be able to destroy controller I had to remove related routes in routes.rb. P.S. I'm using rails 3.1