Currently, I have a session login method that has environment-specific configurations.
def log_in(user)
cookies.permanent[:remember_token] = { :value => user.remember_token, :domain => :all }
end
the :domain => differs between :all for production and 'lvh.me' for development.
How can I set up a YAML file that loads the environment-specific configurations, as shown in RailsCast #85?
I tried the code below, but get back unitialized constant RAILS_ENV
app_config.yml
development:
domain: lvh.me
test:
domain: :all
production:
domain: :all
load_app_config.rb
APP_CONFIG = YAML.load_file(::Rails.root.join('config','app_config.yml'))[RAILS_ENV]
In the end, I went with: