Managing routes with rails
I want to be able to better understand rails routes file, but I can't figure it out by myself since it's too complex.

Basically I have 3 controllers. They are: Admin, ManageProduct and ManageProductCategory (I have 2 models: Product, ProductCategory and model ProductCategory has_many/belongs_to products relationship)

Admin controller actions:

- index (redirects to login)
- login
- logout
- attempt

ManageProduct controller actions:

- index
- CRUD (delete, edit, show, list) for model product

ManageProductCategory

- index
- CRUD (delete, edit, show, list) for model product_category

I want to be able to manage my application routes so that if I type in the browser:

    mywebsite/admin
    mywebsite/admin/login
    mywebsite/admin/logout
    mywebsite/admin/manage_product
    mywebsite/admin/manage_product_category/1
    mywebsite/admin/manage_product/delete
    mywebsite/admin/manage_product/10

And so on...

The problem is I can't figure out how to setup my route files so that rails understand that admin/manage_product is not a admin controller action...

NOTICE: Everything is already working (CRUD for 2 models and links to action via standard not recommended route

    match ':controller(/:action(/:id(.:format)))'


Really appreciate your help and attention

Regards

Managing routes with rails
===

I want to be able to better understand rails routes file, but I can't figure it out by myself since it's too complex.

Basically I have 3 controllers. They are: Admin, ManageProduct and ManageProductCategory (I have 2 models: Product, ProductCategory and model ProductCategory has_many/belongs_to products relationship)

Admin controller actions:

- index (redirects to login)
- login
- logout
- attempt

ManageProduct controller actions:

- index
- CRUD (delete, edit, show, list) for model product

ManageProductCategory

- index
- CRUD (delete, edit, show, list) for model product_category

I want to be able to manage my application routes so that if I type in the browser:

    mywebsite/admin
    mywebsite/admin/login
    mywebsite/admin/logout
    mywebsite/admin/manage_product
    mywebsite/admin/manage_product_category/1
    mywebsite/admin/manage_product/delete
    mywebsite/admin/manage_product/10

And so on...

The problem is I can't figure out how to setup my route files so that rails understand that admin/manage_product is not a admin controller action...

NOTICE: Everything is already working (CRUD for 2 models and links to action via standard not recommended route

    match ':controller(/:action(/:id(.:format)))'


Really appreciate your help and attention

Regards
