在我的routes.rb
文件中,我想使用rails3中的子域約束功能,但是我想從捕獲所有路由中排除某些域。我不想在特定子域中擁有某個控制器。這樣做最好的做法是什麼?子域約束和排除某些子域
# this subdomain i dont want all of the catch all routes
constraints :subdomain => "signup" do
resources :users
end
# here I want to catch all but exclude the "signup" subdomain
constraints :subdomain => /.+/ do
resources :cars
resources :stations
end
謝謝你幫助我使用這種技術。我自己修改它以進一步限制正則表達式與之後的第一位和附加字符不匹配。 – 2011-05-08 11:13:09
@edgerunner感謝您的Rubular鏈接! – scarver2 2013-07-18 19:14:16