I was hoping someone could suggest some best practices for configuring Rails applications using a database (i.e. persisting configuration settings to a database rather than a flat file). My reasoning for this is that I have an application that will run on multiple servers and there are some configuration settings that are fairly dynamic and I would want to change them without having to make a change on every server.
In other languages, I've seen this done by using a simple configuration table (like name/value pairs) and a singleton that exposes the configuration data and periodically gets refreshed. Is there a similar - or better - way to do this with Rails?
Thanks in advance.
Not the prettiest solution I'm sure, but one thing we've done for our internal apps is create a 'config' field that is simply a text field containing a serialized hash. Then we deserialize on load from the db.
https://github.com/Squeegy/rails-settings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With