# App with different homepage per domain

**URL:** <https://www.ruby-forum.com/t/app-with-different-homepage-per-domain/113437>\
**Category:** Rails\
**Created:** [August 31, 2007, 1:43am UTC](https://www.ruby-forum.com/t/app-with-different-homepage-per-domain/113437 "2007-08-31T01:43:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![devaulw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@devaulw](https://www.ruby-forum.com/u/devaulw)\
**Post date:** [August 31, 2007, 1:43am UTC](https://www.ruby-forum.com/t/app-with-different-homepage-per-domain/113437/1 "2007-08-31T01:43:27Z")

</div>

I am trying to use a different homepage per domain pointed to a rails  
app. Based on the domain, only a subset of application data applies.  
Can you tell me how you would address this problem? The request\_routing  
plugin might help but I am wondering if I should put the logic in the  
view since I’m not sure what controller applies to the index.html page.  
Somehow that feels wrong to me.

Thanks for any input.

Bill

P.S. I’ve tried googling for assistance but I don’t seem to have a  
decent search.

---

<div class="post-metadata">

**Author:** ![devaulw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@devaulw](https://www.ruby-forum.com/u/devaulw)\
**Post date:** [August 31, 2007, 1:56am UTC](https://www.ruby-forum.com/t/app-with-different-homepage-per-domain/113437/2 "2007-08-31T01:56:10Z")

</div>

Acts\_as\_indexed is a plugin for Ruby on Rails. With only a few simple  
setup steps, and no external dependencies, it is designed to get you  
up and running with indexed full-text search in as small a time as  
possible.  
The pure Ruby implementation of this full-text search makes for a  
tool that is totally portable, and suitable for almost any  
application requiring such capabilities.

Search queries support many standard boolean operators, namely  
exclusion of a term through the use of ‘-’ and the matching of  
phrases through the use of quotation marks.

Full details, install and documentation: [http://douglasfshearer.com/](http://douglasfshearer.com/)  
blog/rails-plugin-acts\_as\_indexed

svn: svn://svn.douglasfshearer.com/rails/plugins/acts\_as\_indexed

Feedback is most definitely appreciated.

Cheers.

Douglas F Shearer  
removed\_email\_address@domain.invalid

> **[Douglas F Shearer](https://douglasfshearer.com/)**
>
> Software developer, mountainbiker.

---

<div class="post-metadata">

**Author:** ![devaulw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@devaulw](https://www.ruby-forum.com/u/devaulw)\
**Post date:** [August 31, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/app-with-different-homepage-per-domain/113437/3 "2007-08-31T18:59:18Z")

</div>

Bill,  
I’ve been addressing the same problem as you for about the last 7  
months. I don’t know what the business aspects of your desire are, but  
there’s a long way between now and getting it done. The basic approach  
is to have all database tables as children of a “MAIN” table. When the  
request arrives you ‘scope’ on the request.host to call the  
appropriate 'main.subtable.find(:all).  
I can’t tell you the PAIN it took me to ferret this out.  
Kathy

On Aug 30, 6:43 pm, Bill D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![devaulw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@devaulw](https://www.ruby-forum.com/u/devaulw)\
**Post date:** [August 31, 2007, 8:31pm UTC](https://www.ruby-forum.com/t/app-with-different-homepage-per-domain/113437/4 "2007-08-31T20:31:13Z")

</div>

KathysKode:

I think my situation is a little simpler than yours. I am along the  
lines of a shopping mall where each store’s items share a common  
database. Under one domain for the shopping mall I’d like to show all  
the items from all the stores. Under each store’s domain, I’d only want  
to show that store’s items. The subset of applicable data depends on  
the domain and I’d like each domain to have a different homepage.

Bill

---

<div class="post-metadata">

**Author:** ![devaulw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@devaulw](https://www.ruby-forum.com/u/devaulw)\
**Post date:** [October 19, 2007, 10:20am UTC](https://www.ruby-forum.com/t/app-with-different-homepage-per-domain/113437/5 "2007-10-19T10:20:11Z")

</div>

Bill,  
Did you get anywhere with this?

I think I want to do the same thing: several sites where a large part of  
the code and data base is common.

I’ve started a thread on this but there is no response.  
[http://www.ruby-forum.com/topic/128348#new](http://www.ruby-forum.com/topic/128348#new)

There#s various talk about similar subjects so I think a number of  
people are trying to do the same thing.

---

<div class="post-metadata">

**Author:** ![devaulw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8e7dd6/32.png) [@devaulw](https://www.ruby-forum.com/u/devaulw)\
**Post date:** [October 19, 2007, 2:35pm UTC](https://www.ruby-forum.com/t/app-with-different-homepage-per-domain/113437/6 "2007-10-19T14:35:24Z")

</div>

This thread may help  
[http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/9c578165f1511cb3/?hl=en#](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/9c578165f1511cb3/?hl=en#)

–linoj

On Oct 19, 4:20 am, John L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
