Please read the post and watch the podcast.
The basic idea is:
Define a “yml” file which contains the configuration information under the “config/“ directory;
Add a “initializer” ruby file(such as “load_config.rb”) in the “config/initializers/“ directory which has the code to load the yml file;
In your Rails code use the loaded configuration information.
1 | development: |
1 | APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/config.yml")[RAILS_ENV] |
1 | def authenticate |