RailsExpert.com wrote:
John,
I am not sure exactly what you’re asking but if you are trying to
‘personalize’ many separate websites based on the calling domain
( something.com ) then I might be able to help.
I created a synthetic example of this at WebRancher.com where one code
based reads the ‘request.host’ object and based on the domain name
serves the appicable data to the application framework.
David
Here’s thing…
First I have a DB that goes something like this:
ID BRAND EST_YEAR HISTORY CURRENT_MODELS etc etc
1 BMW 1900 blah,blah,blah 1series,3series,5series
2 MercedesBenz 1901 blah,blah,blah c-klasse,e-klasse,s-klasse
3 Audi 1902 blah,blah,blah a3,a4,a5,a6,a8
Then someone goes to this script here on my domain:
http://www.MyDomain.com/car-data.rb?carBrand=BMW
http://www.MyDomain.com/car-data.rb?carBrand=MercedesBenz
http://www.MyDomain.com/car-data.rb?carBrand=Audi
Now, instead of creating a separate page for each car-brand - which is
both a tedious task and can’t really be updated, etc. once I change the
design of the site for example, or whatever, so instead of having static
HTML pages for each brand I want to create one template page and then
have a script, based on the ‘carBrand’ variable in the link replace
particular fields in that template with the data from the DB.
So for example the template page would look like:
Car Brand: $brand
Established in: $est_year
History information, facts, data, years, etc.: $history
The manufacturer currently has the following models in production:
$current_models
And so on…
And once someone comes with
http://www.MyDomain.com/car-data.rb?carBrand=BMW
It will replace the variables with:
Car Brand: BMW
Established in: 1900
History information, facts, data, years, etc.: blah,blah,blah
The manufacturer currently has the following models in production:
1series,3series,5series
So that’s pretty much my whole idea right now. I’m sure it’s a pretty
basic programming task for someone who knows their way around
programming, but for me it’s still in the dark as I don’t have any
reference point to start from and build on.
So again - all and any suggestions and tips are greatly appreciated!
Thanks again guys!