Can we have multi-level subdomain in Rails like this?
sub1.sub2.mysite.com
Can we have multi-level subdomain in Rails like this?
sub1.sub2.mysite.com
Yes, you can check the subdomain the app is accessed from using request.subdomains
But if you are going to do something more advanced you should probably use subdomain-fu
I don't see any reason why you couldn't have a subdomain of a subdomain being used in a rails app.
You'll want to setup a wildcard A record in your domain DNS and configure your http server to accept wildcard server aliases.
Then in your application_controller you'll probably want a before_filter that does some juju with
request.host
to do whatever you want, be it
Account.find_by_domain(parsed_request_host)
or whatever.