For example, I created this post_controller earlier in the project but I decide to destroy it later.
Then I use
rails destroy controller post_controller
to remove the controller. But I also want to remove the views that attach to this controller.
In this case, they are the erb files in the app/views/post folder. How can I remove those erb files?
You can run
rails d scaffold postbut be warned this will destroy the rest of the scaffolded elements including any models/routes/assets etc. Here is the full list of what it will destroy:Edit:
To clarify,
rails dis just shorthand forrails destroy. It can also be used asrails generate/rails g.