Rails Destroy
Sometimes, you generate controller or model that you don't need. You want to reverse the things you've generated. Instead of deleting files manually one by one. Rails has a command for that.
here's the codes.
rails destroy controller <controller name>
rails destroy model <model name>
rails destroy scaffold <model name>
Enjoy :)
Written by Maynard Cabalitan
Related protips
1 Response
I was just talking about this the other day to a co-worker who is starting with Rails. He used to delete file by file when mistyping a field or type in the scaffold. I will share this with him so he can remember! :) Thanks for sharing.
There is another useful option called --pretend that previews what it would actually generate but doesn't create anything.
over 1 year ago
·
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#