Large controller


#1

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


#2

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

script/generate controller admin/faq

-Michael


#3

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 :wink:

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

Philipp


#4

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