I will only partialy answer your question.
If you want to store it as some variable availble to all users, then probably you can create a my_new_variable.rb
in config/initializers
. And you can generate some code that defines and initializes your variable (maybe constant is better). Then is a bad part of this approach - you have to restart your server. If you are using passanger, then just touch tmp/restart.txt
and it's done.
You can also store it in yml file and load it on server start.
Even if you would store it in a different way, probably the easiest way is to restart server to load this new variable. Otherwise on every request you should check if there is new variable availble (on example check last update time on a file), or reload this file.
So, for me it looks like the easiest way is to store it in db.