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?
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:
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.
In your config/application_settings.rb
and use it anywhere in your app
which returns 200