Skip to content

Instantly share code, notes, and snippets.

@tadas-s
Created February 19, 2014 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadas-s/9090936 to your computer and use it in GitHub Desktop.
Save tadas-s/9090936 to your computer and use it in GitHub Desktop.
if Rails.env.test?
module ActionDispatch
module Routing
module UrlFor
alias_method :original_url_options, :url_options
def url_options
if self.respond_to? :request
original_url_options.merge({:host => request.host, :port => request.port})
else
original_url_options
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment