Rails Basecamp style subdomains best practice
问题 My goal is to have separate user accounts for each subdomain. Under no circumstance do I want cross-pollination between subdomains. I've looked over Robby Russle, and DHH's thoughts (both are pre-Rails3 though). The controller handling is pretty straight forward, my questions is about keeping the model's data separated. What's the best way to keep user1 from seeing user2's data? Some idea's might include: Add a subdomain_id foreign key to every model - Advantage , simple one-to-many