在我的路线文件中,我有
resources :contractors, :path => '/'
resources :customers, :path => '/'
注意:两者都有自己的注册/设计模型。
现在的问题是,如果contractor
登录。他可以正常浏览。但是当customer
登录它说Couldn't find Contractr with id=1
。现在如果我颠倒顺序
resources :customers, :path => '/'
resources :contractors, :path => '/'
它适用于客户而不适用于承包商。我想我知道这里的问题是什么。但是我该如何解决呢?我不知道希望/customers/
或/contractors/
作为 URL 中的前缀