Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8755641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:53:42+00:00 2026-06-13T13:53:42+00:00

For example, I created this post_controller earlier in the project but I decide to

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:53:42+00:00Added an answer on June 13, 2026 at 1:53 pm

    You can run rails d scaffold post but 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:

    ⌘ ~/testapp/ rails d scaffold post
      invoke  active_record
      remove    migration.rb
      remove    app/models/post_controller.rb
      invoke    test_unit
      remove      test/unit/post_controller_test.rb
      remove      test/fixtures/post_controllers.yml
      invoke  resource_route
       route    resources :post_controllers
      invoke  scaffold_controller
      remove    app/controllers/post_controllers_controller.rb
      invoke    erb
      remove      app/views/post_controllers
      remove      app/views/post_controllers/index.html.erb
      remove      app/views/post_controllers/edit.html.erb
      remove      app/views/post_controllers/show.html.erb
      remove      app/views/post_controllers/new.html.erb
      remove      app/views/post_controllers/_form.html.erb
      invoke    test_unit
      remove      test/functional/post_controllers_controller_test.rb
      invoke    helper
      remove      app/helpers/post_controllers_helper.rb
      invoke      test_unit
      remove        test/unit/helpers/post_controllers_helper_test.rb
      invoke  assets
      invoke    coffee
      remove      app/assets/javascripts/post_controllers.js.coffee
      invoke    scss
      remove      app/assets/stylesheets/post_controllers.css.scss
      invoke  scss
    

    Edit:

    To clarify, rails d is just shorthand for rails destroy. It can also be used as rails generate/ rails g.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created this example The remove function doesn't work, and I can't figure out
I've created this simple example program, but this doesn't work. it won't connect. any
I'm trying to follow this example. I've created an action in my controller: def
For example I now created a this tiny class: public static class FileSystemInfoComparers<T> where
I created a duplex service ( NetTcpBinding ) like this example : I used
I created a simple application inspired by this example in order to test all
Just created an acc on SO to ask this :) Assuming this simplified example:
I have a loop created with each, check this example: $('.foo').each(function(i){ //do stuff });
I asked this question earlier and thought it was fixed, but it's not. Previous
I'm new to cakephp and following this tutorial. http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html I have created the blog

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.