Created
August 1, 2017 19:47
-
-
Save awesome/b1b4e16cc90b884ad0dd33cf568e0c88 to your computer and use it in GitHub Desktop.
Easily load config files in Rails 4.2
This file contains hidden or 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
| # "Easily load config files | |
| # OK, I might be biased. But having a built-in way to load config files is going to be awesome. | |
| # config_for, new in Rails 4.2, works exactly like you’d expect:" | |
| # http://www.justinweiss.com/articles/the-lesser-known-features-in-rails-4-dot-2/ | |
| Rails.application.config_for(:database) | |
| # => {"adapter"=>"mysql2", "encoding"=>"utf8", "database"=>"development_db", "username"=>"root", "password"=>nil, "host"=>"localhost", "pool"=>5, "socket"=>"/tmp/mysql.sock"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment