Topic: Subdomains based upon a tag...
I'm having issues implementing a subdomain system for my rails app...
I have looked at Request Routing Plugin and account_location but they don't seem to be what I want.
My final aim is to run one application that three urls feed off. A business site, a work blog and a skiing blog (work and business are two different blogs - different businesses but related...).
I have a Posts controller and from it I want to be able to write a post and depending on what it is tagged with - this will determine on which site it shows up on.
Currently I have working (in apache2) - a.localhost:3000 (work blog), b.localhost:3000 (ski blog) and localhost:3000 (business blog and site) - but obviously there is no content on these sites - this is where I'm stuck.
What I think I'm to do is to create a before_filter in my applicaiton.rb that checks what domain I'm on first (a.localhost:3000) and only show the posts that are associated with the tag that is associated with a.localhost:3000 (one tag per domain - I may change this to a category but for now it is fine).
If anyone has any ideas I would love to hear them - if this is unclear just let me know and I'll try and rephrase.
Last edited by Coopr (2008-01-19 01:40:06)