Hello again,
For information purposes I wanted to follow up on this discussion with
an already existing solution in edge.
map.resources :customers do |ns|
ns.namespace(:customers) do |customers|
customers.resources :tags
end
end
GET /customers/
{:action=>"index", :controller=>"customers"}
POST /customers.:format/
{:action=>"create", :controller=>"customers"}
GET /customers/new/
{:action=>"new", :controller=>"customers"}
GET /customers/new.:format/
{:action=>"new", :controller=>"customers"}
GET /customers/:id/edit/
{:action=>"edit", :controller=>"customers"}
GET /customers/:id/edit.:format/
{:action=>"edit", :controller=>"customers"}
GET /customers/:id/
{:action=>"show", :controller=>"customers"}
GET /customers/:id.:format/
{:action=>"show", :controller=>"customers"}
PUT /customers/:id/
{:action=>"update", :controller=>"customers"}
PUT /customers/:id.:format/
{:action=>"update", :controller=>"customers"}
DELETE /customers/:id/
{:action=>"destroy", :controller=>"customers"}
DELETE /customers/:id.:format/
{:action=>"destroy", :controller=>"customers"}
GET /customers/:customer_id/tags/
{:action=>"index", :controller=>"customers/tags"}
GET /customers/:customer_id/tags.:format/
{:action=>"index", :controller=>"customers/tags"}
POST /customers/:customer_id/tags/
{:action=>"create", :controller=>"customers/tags"}
POST /customers/:customer_id/tags.:format/
{:action=>"create", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/new/
{:action=>"new", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/new/
{:action=>"new", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/new.:format/
{:action=>"new", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/new.:format/
{:action=>"new", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/:id/edit/
{:action=>"edit", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/:id/edit/
{:action=>"edit", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/:id/edit.:format/
{:action=>"edit", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/:id/edit.:format/
{:action=>"edit", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/:id/
{:action=>"show", :controller=>"customers/tags"}
GET /customers/:customer_id/tags/:id.:format/
{:action=>"show", :controller=>"customers/tags"}
PUT /customers/:customer_id/tags/:id/
{:action=>"update", :controller=>"customers/tags"}
PUT /customers/:customer_id/tags/:id.:format/
{:action=>"update", :controller=>"customers/tags"}
DELETE /customers/:customer_id/tags/:id/
{:action=>"destroy", :controller=>"customers/tags"}
DELETE /customers/:customer_id/tags/:id.:format/
{:action=>"destroy", :controller=>"customers/tags"}
Now your controllers can be organized in a namespaced structure:
/app/controllers/customers_controller.rb => CustomersController
/app/controllers/customers/tags_controller.rb =>
Customers::TagsController
Regards,
Peter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---