我有 3 层嵌套。
routes.rb 看起来像这样
resources :clients do
resources :departments do
resources :tasks
end
end
我想创建一个看起来像这样的自定义路径
/clients/:client_id/departments/:department_id/tasks/data
我尝试添加以下内容
resources :clients do
resources :departments do
resources :tasks
member do
get "data"
end
end
end
这将创建路线
/clients/:client_id/departments/:department_id/tasks/:task_id/data
我将如何删除路径中的 :task_id 部分?