rails destroy
Destroy Rails resources. More information: https://guides.rubyonrails.org/command_line.html#bin-rails-destroy.
-
List all available generators to destroy:
rails destroy
-
Destroy a model named Post:
rails destroy model {{Post}}
-
Destroy a controller named Posts:
rails destroy controller {{Posts}}
-
Destroy a migration that creates Posts:
rails destroy migration {{CreatePosts}}
-
Destroy a scaffold for a model named Post:
rails destroy scaffold {{Post}}
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.