i.e. delete all the files it created and roll back any changes made? Not necessarily to the db, but more to the config files.
E.g. automatically deleting all the resource mappings for the model/controller deleted in the routes.rb file and everywhere else that changes might have been made?
Thanks.
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.1You can undo a rails generate in following ways:
rails destroy MODEL
rails destroy controller_name
You can destroy all things that was created same way except little thing change. For controller,
For Model
you just put
d(destroy)
instead ofg(generate)
in your migration.All generations of rails have a destroy of them, so , if you create by generator a (for example) scaffold named "tasks", to destroy all the changes of that ganerate you will have to type:
Hope it helps you.
Removed scaffolding for selected model
Rails 3.2 adds a new
d
shortcut to the command, so now you can write: