4535: Add default_url_options to application controller that consults
[arvados.git] / services / api / app / controllers / application_controller.rb
index 381c5c991ff640d20b950ae17f5c6377ec5f5dab..762bbd9c1c8bd39cf88ab551eb9221489c5a5455 100644 (file)
@@ -56,6 +56,14 @@ class ApplicationController < ActionController::Base
                 :with => :render_not_found)
   end
 
+  def default_url_options
+    if Rails.configuration.host
+      {:host => Rails.configuration.host}
+    else
+      {}
+    end
+  end
+
   def index
     @objects.uniq!(&:id) if @select.nil? or @select.include? "id"
     if params[:eager] and params[:eager] != '0' and params[:eager] != 0 and params[:eager] != ''