Created
July 31, 2017 15:34
-
-
Save floehopper/bd27ed6657c4ccef17521b6c508e3e34 to your computer and use it in GitHub Desktop.
Rails app configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/application.rb | |
module Foo | |
class Railtie < Rails::Railtie | |
config.foo = ActiveSupport::OrderedOptions.new | |
end | |
def self.config | |
Railtie.config.foo | |
end | |
class Application < Rails::Application | |
# Rails configuration | |
# e.g. config.time_zone = 'Central Time (US & Canada)' | |
end | |
end | |
# config/initializers/bar.rb | |
Foo.config.bar = 'wem' | |
# some other file in the application | |
p Foo.config.bar # => 'wem' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment