0

The closest thing I could find was this: How do I reverse a 'rails generate'?

But it's scaffolded models/views/controllers. For example, assume I have the following in:

/config/routes.rb

get '/choose-chocolate', to: `chocolates#choose_chocolate`

/app/controllers/chocolates_controller.rb

def choose_chocolate
    # code
end

/app/views/chocolate/choose_chocolate.rb

%h1 Choose Chocolate

= render 'form'

= link_to 'choose_chocolate_submit', val: choc_1, class: "btn choc"

= link_to 'choose_chocolate_submit', val: choc_2, class: "btn choc"

I was hoping maybe there was a way I could simply delete VIEW and ACTION and possibly the ROUTE without going into each file, etc.

dsomel21
  • 576
  • 2
  • 8
  • 27

1 Answers1

0

There's no rails destroy action or similar. Just go into each and manually delete it, or better yet just don't scaffold. Scaffolding was neat for the "instant blog on Rails" demos, but in reality is rarely all that useful given how much you need to undo.

tibbon
  • 1,018
  • 2
  • 16
  • 30