Hi,
I’m new to Ruby and Rails and I’m making a simple application to help me
learn how to use it. At the moment I have an admin controller. When the
user
goes here I want them to be presented with 3 choices: manage photos,
news
and pages. From there I want them to be able to CRUD each type.
At the moment in the admin controller I’ve defined actions “photo”,
“news”
and “page”. So that the URL looks like www.blah.com/admin/photo. I want
to
be able to have it so that I can then go www.blah.com/admin/photo/add or
www.blah.com/admin/news/delete. I would rather have it as that instead
of
www.blah.com/admin/photo_add or …/admin/photo_delete.
Do I need to make a child controller of admin called “photo”, “news” and
“page” and then do a scaffold or can I just define actions like
“photo_add”,
“photo_delete”, “photo_edit” and then just do some tricky routing and do
all
the CRUD stuff myself? I’d really prefer to start off doing something
with a
combination of scaffolding and routing, because that will be easiest for
me.
Thanks for anybodies help in advance. BTW, I love Rails. I am very
proficient with PHP but when I saw scaffolding and migrations I was
absolutely sold on Rails. DHH have my children.
Chris Lloyd