Skip to content

Instantly share code, notes, and snippets.

@lukaskonarovsky
Created January 8, 2009 19:03
Show Gist options
  • Save lukaskonarovsky/44838 to your computer and use it in GitHub Desktop.
Save lukaskonarovsky/44838 to your computer and use it in GitHub Desktop.
Placing App Config outside enviroment files into YML.
# Load application specific configuration
require 'ostruct'
AppConfig = OpenStruct.new(YAML.load_file('config/config.yml')[Rails.env])
Rails::Initializer.run do |config|
# Sessions
config.action_controller.session_store = :active_record_store
config.action_controller.session = {
:session_key => AppConfig.session_key,
:secret => AppConfig.secret,
:session_domain => AppConfig.session_domain
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment