I need to force the host in one of the environments in my rails app.
I've can get the override to work by including
def default_url_options(opts={})
opts.merge({:host => 'stg.my-host.com'})
end
in app/controllers/application.rb
But is there a way to set this on initialize, preferably in a config/environments/... file? I'd like to keep conditional env logic out of the controller.
But when I try
config.action_controller.default_url_options = { ... }
or even
ActionController::Base.default_url_options = { ... }
I get "undefined method," even if a wrap in a config.after_initialize { ... }
any thoughts?