I want to start up my Rails development server like this:
script/server OFFLINE_MODE=1
and have a method in application_controller.rb
that checks for the presence of that constant:
helper_method :offline_mode?
def offline_mode?
defined?(OFFLINE_MODE) ? true : false
end
so I can hide stuff in my app when I'm coding without access to the internet. For some reason though, OFFLINE_MODE doesn't ever seem to be defined and the method always returns false.. thoughts?