Forum: Ruby on Rails large controller

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Philipp Engel (Guest)
on 2006-05-15 21:17
(Received via mailing list)
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?


Michael T. (Guest)
on 2006-05-15 21:20
(Received via mailing list)
I'm a bit confused, does this not work for you:

script/generate controller admin/faq

Philipp Engel (Guest)
on 2006-05-15 21:33
(Received via mailing list)
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!

Michael T. (Guest)
on 2006-05-16 00:55
(Received via mailing list)
Don't be embarrased.  It took me forever to figure that one out,
especially since it gets rewritten as Admin::FaqController

Glad it worked.

This topic is locked and can not be replied to.