module ActionDispatch::Routing::UrlFor

def _routes_context

def _routes_context
  self
end

def _with_routes(routes)

def _with_routes(routes)
  old_routes, @_routes = @_routes, routes
  yield
ensure
  @_routes = old_routes
end

def initialize(*)

def initialize(*)
  @_routes = nil
  super
end

def url_for(options = nil)

# => 'http://somehost.org/tasks/testing?number=33'
url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :number => '33'
# => 'http://somehost.org/tasks/testing/'
url_for :controller => 'tasks', :action => 'testing', :trailing_slash => true
# => '/tasks/testing#ok'
url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :anchor => 'ok', :only_path => true
# => 'http://somehost.org:8080/tasks/testing'
url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :port => '8080'

Examples:

+url_for+ is forwarded to the Routes module.
Any other key (:controller, :action, etc.) given to

* :trailing_slash - If true, adds a trailing slash, as in "/archive/2009/"
* :anchor - An anchor name to be appended to the path.
* :port - Optionally specify the port to connect to.
ActionDispatch::Http::URL.tld_length, which in turn defaults to 1.
:subdomain or :domain are supplied. Defaults to
* :tld_length - Number of labels the TLD id composed of, only used if
to split the domain from the host.
* :domain - Specifies the domain of the link, using the +tld_length+
If false, removes all subdomains from the host part of the link.
to split the subdomain from the host.
* :subdomain - Specifies the subdomain of the link, using the +tld_length+
provided either explicitly, or via +default_url_options+.
If :only_path is false, this option must be
* :host - Specifies the host the link should be targeted at.
* :protocol - The protocol to connect to. Defaults to 'http'.
* :only_path - If true, the relative url is returned. Defaults to +false+.

routes defined in routes.rb. The following options are supported:
Generate a url based on the options provided, default_url_options and the
def url_for(options = nil)
  case options
  when String
    options
  when nil, Hash
    _routes.url_for((options || {}).symbolize_keys.reverse_merge!(url_options))
  else
    polymorphic_url(options)
  end
end

def url_options

def url_options
  default_url_options
end