나는 당신이 원하는 것을 얻기 위해 scope
을 사용할 수 있다고 생각합니다. 아마도이 같은 :
portal_products GET /portal/:company_id/products(.:format) {:action=>"index", :controller=>"portal/products"}
POST /portal/:company_id/products(.:format) {:action=>"create", :controller=>"portal/products"}
new_portal_product GET /portal/:company_id/products/new(.:format) {:action=>"new", :controller=>"portal/products"}
edit_portal_product GET /portal/:company_id/products/:id/edit(.:format) {:action=>"edit", :controller=>"portal/products"}
portal_product GET /portal/:company_id/products/:id(.:format) {:action=>"show", :controller=>"portal/products"}
PUT /portal/:company_id/products/:id(.:format) {:action=>"update", :controller=>"portal/products"}
DELETE /portal/:company_id/products/:id(.:format) {:action=>"destroy", :controller=>"portal/products"}
편집 : 대신 자원의 실수로 사용되는 자원은 다음 경로를 생성합니다
namespace "portal" do
scope ":company_id" do
resources :products
end
end
. 이제 해결되었습니다.
'일치'를 사용하면 어떤 점이 좋습니까? – apneadiving