尝试从网址中删除字符串:
resource :editor do
resources :profiles
end
器/编辑器/简档
如何从网址中删除“编辑”部分?
答案 0 :(得分:2)
如果你不想要编辑部分,你可能不需要在第一时间使用嵌套路线,但最重要的是你需要什么样的路线显示页面,即现在它必须像:
/编辑/:editor_id /简档/:ID
如果您不需要编辑器及其ID,则不应在此处使用嵌套路由。
答案 1 :(得分:0)
您可以使用浅路线
resource :editor do
resources :profiles, :shallow => true
end
通过这种方式,您将能够/editor/:iditor_id/profiles
和/profiles