Skip to content

Instantly share code, notes, and snippets.

@danreedy
Created September 20, 2011 16:06
Show Gist options
  • Save danreedy/1229523 to your computer and use it in GitHub Desktop.
Save danreedy/1229523 to your computer and use it in GitHub Desktop.
Setting engine specific settings in global environment files
Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# <snip>
config.my_setting = "bar"
end
module MyEngine
class Engine < Rails::Engine
config.before_initialize do |app|
app.config.my_setting = "foo"
end
end
end
class SomeController < ApplicationController
def index
my_setting = Rails.application.config.my_setting
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment