0

I was trying to delete (and then re-generate) the welcome controller in my rails Project. Since I misspelled some things and now nothing is working correctly (I am learning Rails right now)

So I ran

rails destroy controller welcome

But now nothing happens...
I've been waiting for over ten minutes for something to happen, but nothing...
No errors or any messages
And my project is as small as it could be ...

Any ideas on what I could do? Besides from trashing everything and starting form scratch again?

---Edit---
I fixed my initial problem and my project works again, but being able to delete controllers is something that I would like to be able to.

NIoSaT
  • 423
  • 6
  • 22
  • 1
    If you able to learn about how Rails's generate files for you, you can remove them manually without commands. I know commands are something magic that newcomers love, but understanding what the command does also a good way to learn Rails. – yeuem1vannam Dec 11 '17 at 14:57
  • 1
    that was/is my problem I don't know what the magical rails commands do (yet) So I was hoping to use another command, so I don't forget something and screw up even more ;) – NIoSaT Dec 11 '17 at 14:59

1 Answers1

1

Try to remove routes manually and retry deleting with

rails d controller welcome -p

-p will post output to terminal. Check it for errors. If there are any errors, update answer with information about them. And if no errors are shown, try command again without -p.

Here is a post with lots of comments and answers about this command.

Pavel Oganesyan
  • 6,774
  • 4
  • 46
  • 84
  • how can I delete the routes manually in general? Editing the routes.rb file? When I look into this file I see some routes that I put there, but rails routes gives me even more routes for my other controller/model – NIoSaT Dec 11 '17 at 15:01
  • 1
    Yes, just remove all strings with `welcome` from routes.rb – Pavel Oganesyan Dec 11 '17 at 15:10
  • I did not delete the routes, but now the `rails d controller welcome -p` displays something - so I guess it works now again thanks for the help – NIoSaT Dec 11 '17 at 15:52