url_for (ActionController::UrlWriter)

    # File lib/action_controller/url_rewriter.rb, line 47
        def url_for(options)
          options = self.class.default_url_options.merge(options)

          url = ''

          unless options.delete :only_path
            url << (options.delete(:protocol) || 'http')
            url << '://' unless url.match("://") #dont add separator if its already been specified in :protocol

            raise "Missing host to link to! Please provide :host parameter or set default_url_options[:host]" unless options[:host]

            url << options.delete(:host)
            url << ":#{options.delete(:port)}" if options.key?(:port)
          else
            # Delete the unused options to prevent their appearance in the query string
            [:protocol, :host, :port].each { |k| options.delete k }
          end

          anchor = "##{CGI.escape options.delete(:anchor).to_param.to_s}" if options.key?(:anchor)
          url << Routing::Routes.generate(options, {})
          url << anchor if anchor

          return url
        end