I have a global api key for authenticating the requests to my server's api.
So the api key has to be stored somewhere in my rails application or on the server.
After a quick search, most people seem to recommend to store your keys in a .yml file and load it in your application. They claim that this is safe because the .yml file is not checked to git/source control.
Obviously you should add the .yml file to the .gitignore, otherwise it will be added git.
But If you do that, then how can the file be loaded after deployment(capistrano) if the .yml file isn't checked in to git and doesn't exist on the server?
Here is an example railscast that demonstrates storing the keys in .yml files:
http://railscasts.com/episodes/85-yaml-configuration-file?autoplay=true