If a website is to be “cloned” as a different website, so that only the title, header, banner logo, and the products of the site are different, it probably will be good to move all the site-specific data to a config or yaml file.
(probably better if not using environment.rb so that the data is separate from other data, to keep it more self-contained, and easier for Program Management to edit the data)
In Rails 3, what is a good method to do this? I think the data probably will be mostly text, plus some data such as what product data to fetch from the main DB. The color theme / sprite offsets probably will still be best to keep in a separate .sass file.
I doing the following
Created a my_config.yaml under config folder with development, test and production settings.
Then used a script under initializers to load those settings
Contents of config/my_config.yaml
Contents of config/initializers/load_config.rb
And now I can use APP_CONFIG[‘greet’] in my app
If you common setting across all environment then you can do some thing like the following
Contents of config/my_setting.yaml
Contents of config/initializers/load_settings.rb