I used to put Global variables in environment.rb with my Rails 2.3.8 application such as:
MAX_ALLOWD_ITEMS = 6
It doesn\'t seem to work in
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