creating subdomains

HI All,

I surfed a lot , googled a lot , read/watched railscasts but could not get the solution.

Below is my problem.

  1. I wanted a parent domain www.xyz.com. This parent domain will have two subdomains abc.xyz.com and def.xyz.com.

The parent domain will have a admin user who has capability to create/manage subdomains.
The subdomains should an a siteadmin user who can edit the site information.
Each subdomain will have its own home page.

So If i give http://www.xyz.com in browser address bar it should go to a home page say parent.
If I give http://abc.xyz.com it should go to different page.

The site admin of one subdomain should not be able to edit the other subdomain.

They need to share the same database.

I checked a lot, But could not get the answer.

Please help me to progess i am stuck.

thanks,
S

It sounds like what you're actually after in your application is
what's called multi-tenancy. Try researching a bit on that topic and
you may find what you need.

Here are a few links to get you started:

http://en.wikipedia.org/wiki/Multitenancy
https://github.com/wireframe/multitenant
http://www.slideshare.net/tardate/multitenancy-with-rails