I have 2 subdomains that point to one rails application. My rails application's controllers should serve both subdomains.
Lets call the subdomains www.mydomain.com and demo.mydomain.com. I want 2 to accomplish 3 things:
- Make sure only some of my controllers serve www.mydomain.com and some serve both domains.
- Make sure only a subset of my controllers' actions serve www.mydomain.com and some serve both domains.
- Make sure users use only format :html for demo.mydomain.com (e.g. http://demo.mydomain.com/index.html) and use only formats :json/:xml for www.mydomain.com (e.g. http://www.mydomain.com/index.json).
What's the best way to accomplish both requests ?