You maybe have noticed a file called secrets.yml
in the config directory of a Ruby on Rails 4.1 project. This feature was added as part of Rails 4.1 in order to have a common storage location for the keys and credentials for various services. You can use the secrets.yml for everything from AWS credentials to your secret_key_base (the default in Rails 4.1).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
You have add this file to your .gitignore
file to avoid accidently pushing your keys to git. You can also store your production keys in this file if you wish.
To access the various keys in the secrets.yml file:
1
|
|
Example: The following code will returns the merchant login.
1
|
|
So far so good, That’s it! See ya! :)