コントローラの2つのモジュール(コントローラの基本セットを拡張し、コードの大部分を共有するため)があります。問題の原因となるRailsの制約下の同じルート
私のルートは次のようになり、現在のファイル:
constraints(!Subdomain) do
scope :module => "standalone" do
namespace "account" do
resources :questionnaires, :only => :index do
resources :responses, :except => :new do
member do
get 'save'
end
resources :questions, :only => [:index, :show] do
resources :answers, :only => [:index, :show] do
resource :choice, :only => [:create]
end
end
end
end
end
end
end
constraints(Subdomain) do
scope :module => "organise" do
namespace "account" do
resources :questionnaires, :only => :index do
resources :responses, :except => :new do
member do
get 'save'
end
resources :questions, :only => [:index, :show] do
resources :answers, :only => [:index, :show] do
resource :choice, :only => [:create]
end
end
end
end
end
namespace "admin" do
resources :questionnaires, :only => :index do
resources :responses, :only => [:index, :show]
end
end
end
end
これは、すべての経路の両方のセットがまだ解析されているように見えるし、1セットが他方をオーバーライドすることを除いて、細かい見えた - 一組のみのパスヘルパーを生成します。生成されたルートの分割リストは次のとおりです。http://pastie.org/private/nhvmokit7y0dwywqtdlq(これはかなり大きく、読みやすいようにテキストエディタに配置する必要があります)。
ご覧のとおり、2番目のルートセットのヘルパーは生成されません。また、サイトをナビゲートするときに、それらを正しく認識していないようです。
これまで経験したことがありましたか、回避策を知っている人はいますか?