# Multiple templates - one app

**URL:** <https://www.ruby-forum.com/t/multiple-templates-one-app/65269>\
**Category:** Ruby\
**Created:** [August 17, 2006, 3:37am UTC](https://www.ruby-forum.com/t/multiple-templates-one-app/65269 "2006-08-17T03:37:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Agazoom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8dc957/32.png) [@Agazoom](https://www.ruby-forum.com/u/Agazoom)\
**Post date:** [August 17, 2006, 3:37am UTC](https://www.ruby-forum.com/t/multiple-templates-one-app/65269/1 "2006-08-17T03:37:25Z")

</div>

Hi everyone,  
Rails newbie here so forgive the question if the answer is ridiculously  
obvious.

I am trying to write an app that meets the following requirements. I’d  
like to do it in Rails, but having pored over documentation for that  
past couple of days, don’t even know whether it’s feasible or not.  
Basically:

- One codebase
- multiple domains
- each domain will have the same base functionality, but the look and  
feel will be determined based on a selection of templates

To summarize, I would like a system whereby people can sign up for a  
site, pick their domain name, everyone gets the same functionality, but  
they can choose from a selection of provided templates and customize  
the look and feel of their site.

if it is possible, can you point me in the right direction?

Thanks … your comments are appreciated.

---

<div class="post-metadata">

**Author:** ![Agazoom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8dc957/32.png) [@Agazoom](https://www.ruby-forum.com/u/Agazoom)\
**Post date:** [August 17, 2006, 4:40am UTC](https://www.ruby-forum.com/t/multiple-templates-one-app/65269/2 "2006-08-17T04:40:30Z")

</div>

> To summarize, I would like a system whereby people can sign up for a  
> site, pick their domain name, everyone gets the same functionality, but  
> they can choose from a selection of provided templates and customize  
> the look and feel of their site.

Aha, theme support. Have a look at  
[http://www.mattmccray.com/archives/category/software/rails/theme-support/](http://www.mattmccray.com/archives/category/software/rails/theme-support/)

Max

---

<div class="post-metadata">

**Author:** ![Agazoom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8dc957/32.png) [@Agazoom](https://www.ruby-forum.com/u/Agazoom)\
**Post date:** [August 17, 2006, 5:01am UTC](https://www.ruby-forum.com/t/multiple-templates-one-app/65269/3 "2006-08-17T05:01:36Z")

</div>

You said what I mean in one word … themes! Thanks man! I’ll take a  
look.

---

<div class="post-metadata">

**Author:** ![Agazoom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8dc957/32.png) [@Agazoom](https://www.ruby-forum.com/u/Agazoom)\
**Post date:** [August 17, 2006, 7:22am UTC](https://www.ruby-forum.com/t/multiple-templates-one-app/65269/4 "2006-08-17T07:22:42Z")

</div>

I’m still not sure whether this allows me set up a different theme per  
domain name.

---

<div class="post-metadata">

**Author:** ![Agazoom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8dc957/32.png) [@Agazoom](https://www.ruby-forum.com/u/Agazoom)\
**Post date:** [August 17, 2006, 3:44pm UTC](https://www.ruby-forum.com/t/multiple-templates-one-app/65269/5 "2006-08-17T15:44:20Z")

</div>

On Aug 17, 2006, at 1:20 AM, Agazoom wrote:

> I’m still not sure whether this allows me set up a different theme per  
> domain name.

This is a question better answered on the rails mailing list.  
[http://lists.rubyonrails.org/](http://lists.rubyonrails.org/)

---

<div class="post-metadata">

**Author:** ![Agazoom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8dc957/32.png) [@Agazoom](https://www.ruby-forum.com/u/Agazoom)\
**Post date:** [August 17, 2006, 6:38pm UTC](https://www.ruby-forum.com/t/multiple-templates-one-app/65269/6 "2006-08-17T18:38:47Z")

</div>

On 8/17/06, Agazoom [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m still not sure whether this allows me set up a different theme per  
> domain name.
> 
> Agazoom wrote:
> 
> > You said what I mean in one word … themes! Thanks man! I’ll take a  
> > look.

Just an idea, possibly plain wrong: maybe be it’s possible to do by  
playing with url rewriting/proxying - try to setup all domains to  
point to the same rails app, and pass the domain name as a parameter.  
Still I’m not sure about this, as rails likes to know what its base  
url is, to be able to generate proper links.

J.
