# How to delete a controller in instant rails

**URL:** <https://www.ruby-forum.com/t/how-to-delete-a-controller-in-instant-rails/127584>\
**Category:** Rails\
**Created:** [January 30, 2008, 3:48pm UTC](https://www.ruby-forum.com/t/how-to-delete-a-controller-in-instant-rails/127584 "2008-01-30T15:48:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 30, 2008, 3:48pm UTC](https://www.ruby-forum.com/t/how-to-delete-a-controller-in-instant-rails/127584/1 "2008-01-30T15:48:24Z")

</div>

hi folk i’ve just mistakingly created a crontoller in instant rails  
does anyone know how the delete commands/

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 30, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/how-to-delete-a-controller-in-instant-rails/127584/2 "2008-01-30T16:17:28Z")

</div>

If you created a controller using the generator like this:

ruby script/generate controller some\_name

You can undo it like this:

ruby script/destroy controller some\_name

On Jan 30, 9:47 am, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 30, 2008, 6:01pm UTC](https://www.ruby-forum.com/t/how-to-delete-a-controller-in-instant-rails/127584/3 "2008-01-30T18:01:17Z")

</div>

removed\_email\_address@domain.invalid wrote:

> hi folk i’ve just mistakingly created a crontoller in instant rails  
> does anyone know how the delete commands/

The first thing you should do is look at the entire directory structure  
that was created for you. If you intend to work seriously with rails,  
you will have to know where everything is anyways and it’s good to start  
right now… Actually. most newbie rails books urge you to do this  
towards the beginning of the book

After some research you will find that to delete a controller, you just  
need to remove

/app/controllers/\<controller\_name\>  
/app/views/\<controller\_name\>  
/app/views/layouts/\<controller\_name\>  
/test/functional/\<controller\_name\>  
/test/fixtures/\<controller\_name\>

Having an extra controller around will not hurt anything anyways…

hth

ilan
