I created a settings.rb file under the initializers folder containing values I need initialized once the application starts. However, on running rails s I get a "Uninitialized contant Settings(NameError)
Settings.rb
Settings.defaults[:single_phase] = 500
Settings.defaults[:three_phase] = 300
I created the migration to accompany it already and the view.
Where is the problem?
In your config/application_settings.rb
development:
single_phase: 200
and use it anywhere in your app
APP_SETTINGS['single_phase']
which returns 200
At the time initializers run they do not have access to the model (is it a model?).
If it isn't a model, you can do the following:
SETTINGS = {}
SETTINGS[:single_phase] = 500
However I feel like the figaro gem might be helpful for what you are trying to do.
You can also add arbitrary settings in the application.rb and environment files.