Reverse a scaffold in rails
When we need quick prototyping we still uses scaffolding. (At least I do...), But sometimes we want to revert the scaffold which we generated..
Since scaffolding creates number of files in the project, its a pain in the a&* to remove them manually. So for that rails is providing a method
called
destroy
As per the documentation
destroy Undo code generated with "generate" (short-cut alias: "d")
So in a nutshell,
If you created a scaffold
rails g scaffold Company
you can revert it by executing
rails d scaffold Company name:string
Written by sameera207
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#