Class: ActionDispatch::Routing::RouteSet

Inherits:
Object
  • Object
show all
Defined in:
lib/subdomain_fu/url_rewriter.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#url_for_with_subdomains(options, path_segments = nil) ⇒ Object


6
7
8
9
10
11
12
13
14
15
# File 'lib/subdomain_fu/url_rewriter.rb', line 6

def url_for_with_subdomains(options, path_segments=nil)
  if SubdomainFu.needs_rewrite?(options[:subdomain], (options[:host] || @request.host_with_port)) || options[:only_path] == false
    options[:only_path] = false if SubdomainFu.override_only_path?
    options[:host] = SubdomainFu.rewrite_host_for_subdomains(options.delete(:subdomain), options[:host] || @request.host_with_port)
    # puts "options[:host]: #{options[:host].inspect}"
  else
    options.delete(:subdomain)
  end
  url_for_without_subdomains(options)
end