在我的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