I am trying to create a rails application that assigns one value to a variable when the environment is the development environment, and another value to that same variable w
I use the Yettings gem in Rails 3.2, which allows me to store my application variables in config/yettings.yml like so:
defaults: &defaults
api_key: asdf12345lkj
some_number: 999
an_erb_yetting: <%= "erb stuff works" %>
some_array:
- element1
- element2
development:
<<: *defaults
api_key: api key for dev
test:
<<: *defaults
production:
<<: *defaults
And access them like this:
#/your_rails_app/config/yetting.yml in production
Yetting.some_number #=> 999
Yetting.api_key #=> "asdf12345lkj"