我有以下路线:
resources :projects do
resources :milestones, :comments
end
resources :comments do
member {post :hide}
end
我希望能够写出类似的内容:
resources :projects do
resources :milestones,
resources :comments do
member {post :hide}
end
end
但这会引发错误。
我搜索过互联网,但似乎无法找到我的问题。任何帮助将不胜感激。
答案 0 :(得分:1)
删除资源之间的逗号:里程碑和资源:评论。你的代码应该是
resources :projects do
resources :milestones
resources :comments do
member {post :hide}
end
end