I need to force a host in one of the environments in my rails application.
I can make override work by turning on
def default_url_options(opts={}) opts.merge({:host => 'stg.my-host.com'}) end
in application / controllers / application.rb
But is there a way to set this during initialization, preferably in the config / environment / ... file? I would like to leave the env conditional logic outside the controller.
But when I try
config.action_controller.default_url_options = { ... }
or even
ActionController::Base.default_url_options = { ... }
I get the undefined method, "even if the wrapper is in the config.after_initialize file {...}
any thoughts?
source share