# Large controller

**URL:** <https://www.ruby-forum.com/t/large-controller/60573>\
**Category:** Rails\
**Created:** [May 15, 2006, 7:17pm UTC](https://www.ruby-forum.com/t/large-controller/60573 "2006-05-15T19:17:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philipp\_Engel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e47774/32.png) [@Philipp\_Engel](https://www.ruby-forum.com/u/Philipp_Engel)\
**Post date:** [May 15, 2006, 7:17pm UTC](https://www.ruby-forum.com/t/large-controller/60573/1 "2006-05-15T19:17:10Z")

</div>

Hello there,

I have been thinking about this for some time now, but I am not  
experienced enough using Rails to solve the Problem on my own.

I have a Rails application that has an admin section, from where you  
can, well, administer the whole thing.  
I have CRUD functionality for several data structures there. So the  
controller is getting big, and I don’t want that,  
but I feel I have no choice, as I want to keep the Admin section in  
one place, something like /admin/.

So what I am looking for is something like subcategories of a  
controller, or sub-controllers perhaps?

I have the two Models ‘News’ and ‘Faqs’ for example, and I want to  
access their CRUD functionality under  
/admin/faqs/ and /admin/news/, something like this: /admin/news/edit/1

Is this possible at all?  
If not, how would you do it?

Thanks,

Philipp

---

<div class="post-metadata">

**Author:** ![Philipp\_Engel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e47774/32.png) [@Philipp\_Engel](https://www.ruby-forum.com/u/Philipp_Engel)\
**Post date:** [May 15, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/large-controller/60573/2 "2006-05-15T19:20:29Z")

</div>

I’m a bit confused, does this not work for you:

script/generate controller admin/faq

-Michael

---

<div class="post-metadata">

**Author:** ![Philipp\_Engel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e47774/32.png) [@Philipp\_Engel](https://www.ruby-forum.com/u/Philipp_Engel)\
**Post date:** [May 15, 2006, 7:33pm UTC](https://www.ruby-forum.com/t/large-controller/60573/3 "2006-05-15T19:33:14Z")

</div>

Hello Michael,

Am 15.05.2006 um 19:18 schrieb Michael T.:

> I’m a bit confused, does this not work for you:  
> script/generate controller admin/faq

that’s embarassing now. But how could I have known it might be so easy?  
Ok, I forgot I am working with rails here 😉

So: Thank you very much for pointing that out to me!

Philipp

---

<div class="post-metadata">

**Author:** ![Philipp\_Engel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e47774/32.png) [@Philipp\_Engel](https://www.ruby-forum.com/u/Philipp_Engel)\
**Post date:** [May 15, 2006, 10:55pm UTC](https://www.ruby-forum.com/t/large-controller/60573/4 "2006-05-15T22:55:05Z")

</div>

Don’t be embarrased. It took me forever to figure that one out,  
especially since it gets rewritten as Admin::FaqController

Glad it worked.

Michael
