Structure of app that uses subdomains as account keys

Hello-

I've created a very simple app that uses subdomains as account keys. I followed the instructions at:

http://wiki.rubyonrails.org/rails/pages/HowToUseSubdomainsAsAccountKeys

My question is how should I best structure the ap?. Specifically, I have a public-facing website that explains that app and lets people sign up (www.myapp.com) and then the private part of the app (account_subdomain.myapp.com). Does it make sense to have these be two separate apps or a single app? I like the idea of a single app because it makes it easy to share models (my account model, specifically). However, the two apps do differ somewhat. For instance, going to the root page of each app should render a very different page. I can handle that with some conditional logic, if need be. Also, there are things that make sense for one app, but not the other. For instance, I have an Account resource. Actions like new only make sense on the public website, while actions like edit and delete only make sense on the private app.

What would the group recommend for structuring this app? Two apps or one app with some conditional logic in it?

Thanks in advance.

-Eric

Eric Marthinsen wrote:

What would the group recommend for structuring this app? Two apps or one app with some conditional logic in it?

Thanks in advance.

-Eric

It sounds like you want one app and then to use layouts to generate the differences you want the users to experience..

Do you mean layouts or views? I'd imagine both as the private version of the site would have a fluid layout and the public site a fixed- width, but the major differences are in the content. For instance, the public homepage (www.myapp.com) would be drastically different than the private webpage (account_subdomain.myapp.com).

Does anyone know of any open-source Rails applications that uses subdomains that I could use as reference material?

Regards- Eric

Actually, Railscasts just posted a good tutorial on how to customize content based on subdomain using the subdomain_fu plugin. I'd say it's worth checking out.

Jeff

REST with Rails Oct 4, 2008, Austin, TX http://www.purpleworkshops.com/workshops/rest-and-web-services

That was perfect. Thanks for pointing it out.

-Eric