How to safely store API keys in Rails apps Inspired by a question on reddit: Can you store user API keys in the database? I decided to elaborate just a little bit on this topic. Assuming you want store API keys (or passwords for SSL ceritifcate files) what are your options? What are the pros and cons in each case. Save directly in codebaseHow? #config/environments/production.rb config.mailchimp_ap