【发布时间】:2011-08-20 21:36:46
【问题描述】:
在我的routes.rb 文件中,我想使用 rails3 中的子域约束功能,但是我想从 catch all 路由中排除某些域。我不想在特定的子域中有特定的控制器。这样做的最佳做法是什么。
# 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
【问题讨论】:
标签: ruby-on-rails ruby regex ruby-on-rails-3