I am trying to set the fb app id (used by omniauth) so that its global to devise initialiser and to the controllers.
MORE INFO
I need it in devise initialiser (config/initializer/devise.rb) so that I can set
config.omniauth :facebook, fb_app_id, fb_app_secret
Attempted Solution
I tried adding this info into a yml file ( http://railscasts.com/episodes/85-yaml-configuration-file ), however, looks like the yml hash is set for the controllers, but I can not use it for the devise initialiser.
/home/ubuntu/myapp/config/initializers/devise.rb:215:in `block in <top (required)>': uninitialized constant APP_CONFIG (NameError)
Any ideas?
For those who are interested, I ended up writing up the variables in config/environments/production.rb & config/environments/development.rb
You can set global variables by adding:
(set the appropriate one in production.rb or development.rb)
These can then be used in initialisers, and also in my actual application’s views, controllers, etc.
Read the second answer in:
How to define custom configuration variables in rails