问题
I am working on a project which is a app store. User can subscribe to many applications. I am creating a subdomain for each user and applications he subscribed are again running on subdomains.
Eg.
1). One user registers and selects subdomain as "mysubdomain". Then after logging in he will be accessing everything as "mysubdomain.appstore.com".
2). After registration he subscribes an app, say, "discussion-board".
3). Then the discussion board will be running on "discussion-board.mysubdomain.appstore.com"
Application which allows user which is running on app_store.com and the utility app discussion-board are two different applications.
I know the question sounds more like serverfault.com, but I am putting it here if it can be managed using rails. I am using devise for authentication on rails 3
回答1:
I'd recommend you review:
http://railscasts.com/episodes/221-subdomains-in-rails-3
And take a look at doing the separate apps as Rack middleware.
来源:https://stackoverflow.com/questions/4871766/subdomaining-in-rails-3