I have another example that I have used for a while...

/config/settings.yml
all: &all_environment_settings
  constant_for_all: somethinf

development: &non_production_settings
    <<: *all_environment_settings
    something_different_for_dev: dev stuff

Then you can load this file in a initializer:

/initializers/settings.rb
SETTINGS = YAML.load_file("#{RAILS_ROOT}/config/settings.yml")
[RAILS_ENV].symbolize_keys

Now you can call this through SETTINGS[:constant_for_all]

Both methods will work but if you have requirements for the constants
to change between environments then this would be better...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to