For Rails, how to access or print out config variables (as experiment or test / debugging)

后端 未结 3 1146
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 06:18

For example, in config/environments/production.rb in a Rails 3 app, there is

config.serve_static_assets = false

and many variables

3条回答
  •  借酒劲吻你
    2021-02-02 06:53

    You can also use AppName::Application.config (where AppName is the name of your application) to access the Rails::Application::Configuration object.

    $ AppName::Application.config == Rails.application.config
    true
    

提交回复
热议问题