# File lib/action_controller/base.rb, line 1103
      def redirect_to(options = {}, response_status = {}) #:doc:
        raise ActionControllerError.new("Cannot redirect to nil!") if options.nil?

        if options.is_a?(Hash) && options[:status]
          status = options.delete(:status)
        elsif response_status[:status]
          status = response_status[:status]
        else
          status = 302
        end

        response.redirected_to = options

        case options
          # The scheme name consist of a letter followed by any combination of
          # letters, digits, and the plus ("+"), period ("."), or hyphen ("-")
          # characters; and is terminated by a colon (":").
          when %r{^\w[\w\d+.-]*:.*}
            redirect_to_full_url(options, status)
          when String
            redirect_to_full_url(request.protocol + request.host_with_port + options, status)
          when :back
            if referer = request.headers["Referer"]
              redirect_to(referer, :status=>status)
            else
              raise RedirectBackError
            end
          else
            redirect_to_full_url(url_for(options), status)
        end
      end