ruby on rails - using figaro to store env variables -
i'm confused how use figaro rails 4.2. in application.yml (which checked .gitignore), have this:
secret_key_base: 123456
and in secrets.yml, have this:
development: secret_key_base: <%= env["secret_key_base"] %> the gem should handling env part of setting credentials, according i've read. why not working?
edit 1: in application.yml have: mandrill_user_name: email@example.com , mandrill_password: 1234567890
and in development.rb have:
config.action_mailer.default_url_options = { :host => "localhost:3000" } config.action_mailer.smtp_settings = { address: "smtp.mandrillapp.com", port: 587, domain: "localhost:3000", authentication: "plain", enable_starttls_auto: true, user_name: env["mandrill_user_name"], password: env["mandrill_password"] } shouldn't application.yml taking care of this?
if redundant have variable in secrets.yml file , application.yml file. i.e. use application.yml file declare env vars.
so long in apllication.yml file can call throughout rails app doing:
env["secret_key_base"] varialbles stored in secrets.yml file called via
rails.application.secrets.secret_key_base
Comments
Post a Comment