开发者

Rails 3 Different Routes File Depending on Subdomain

开发者 https://www.devze.com 2023-03-29 09:55 出处:网络
I building a Rails 3 app that has a couple of different su开发者_开发百科bdomains which need to have their own set of routes specific to that subdomain. How do I set this up? I know that I can pass so

I building a Rails 3 app that has a couple of different su开发者_开发百科bdomains which need to have their own set of routes specific to that subdomain. How do I set this up? I know that I can pass something like :constraints { :subdomain => "api" } to an individual route but I don't want to have to do this for each resource/route in my application.

Is there a way to either load a different routes file depending on my subdomain or group subdomain routes into a block?


I'd simply set constraints on the routes as described here.

0

精彩评论

暂无评论...
验证码 换一张
取 消