If you have already tried restarting your server as Ryan suggested, try putting it in your application.rb
like this:
module MyAppName
class Application < Rails::Application
YOUR_GLOBAL_VAR = "test"
end
end
Then you can call it with the namespace in your controllers, views or wherever..
MyAppName::Application::YOUR_GLOBAL_VAR
Another alternative would be using something like settingslogic. With settingslogic, you just create a yml config file and a model (Settings.rb) that points to the config file. Then you can access these settings anywhere in your rails app with:
Settings.my_setting
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…