I have a Rails 3 app where I am using the following convention for setting default values...
Default settings live in config/settings.yml
and look like...
twitter_app_secret: '234wer234'
facebook_app_id: 'notset'
facebook_app_secret: 'notset'
session_token: '123456789er3se901234567890'
...and any wher in the app I can call these settings like Settings.twitter_app_secret. In in the console its like...
ruby-2.1.5@learn marklocklear:learn marklocklear$ rails c
Loading development environment (Rails 3.2.21)
2.1.5 :001 > Settings.twitter_app_secret
=> "234wer234"
I am working on updating this app to Rails 4 and the app will not load with the following error:
NameError: uninitialized constant Settings
This is a legacy app that I have inherited. Did some of the Rails Magic of Rails 3 change in Rails 4 to cause this not to work?
Aucun commentaire:
Enregistrer un commentaire