0

Here is my issue. I need to produce many sites using the same structure (in RoR) and host them on many domains. The only difference between domains will be model data stored in the database and one stylesheet.. everything else will look and operate the same.

I want to be able to structure it so that I only need to change "core.css" in one place to make it update each separate domain. Is there any way that i can do this using ruby on rails? Or is there a better structure i should use?

Thank you,

Troy

Troy Cosentino
  • 4,658
  • 9
  • 37
  • 59

1 Answers1

0

Not sure if I fully understand.

I think you want to have multiple domains pointed to the same project. However you want to change the styling depending on the domain.

if so, just name your css style sheets by the domain name.

<link rel="stylesheet" type="text/css" href="/assets/<%= request.request_uri %>.css" />

(that would be a very lazy way)

I would personally, create a function in application controller, which figures out which stylesheet needs to be used. Then output @style variable.

<link rel="stylesheet" type="text/css" href="/assets/<%= @style %>" />
Andrew Wei
  • 2,020
  • 1
  • 17
  • 28
  • would it be possible to use the same views and controllers too? like everything but data, and a stylesheet will be the same accessed from multiple domains – Troy Cosentino Aug 16 '12 at 23:58