Kyle Decot
Kyle Decot

Reputation: 20815

Rails 3 Different Routes File Depending on Subdomain

I building a Rails 3 app that has a couple of different subdomains 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?

Upvotes: 1

Views: 511

Answers (1)

apneadiving
apneadiving

Reputation: 115531

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

Upvotes: 1

Related Questions