Configuration in Rails app
10+ years most with Ruby on Rails and JavaScript frontend and some Go. My first language is C for 3 years in university.
Let’s not re-write a good article, go to: https://joyofrails.com/articles/mastering-custom-configuration-in-rails
I mostly used config.x configuration that loads a yaml file with config_for that do the multi-environment by default:
module YourApp
class Application < Rails::Application
config.x.external_service_xyz = config_for(:xyz_config) # loading the `xyz_config.yml` file
end
end
This technique is also explained in the above article, check it out.
