    # File lib/merb-core/dispatch/router/behavior.rb, line 697
          def to_route
            raise Error, "The route has already been committed." if @route

            controller = @params[:controller]

            if prefixes = @options[:controller_prefix]
              controller ||= ":controller"

              prefixes.reverse_each do |prefix|
                break if controller =~ %r{^/(.*)} && controller = $1
                controller = "#{prefix}/#{controller}"
              end
            end

            @params.merge!(:controller => controller.to_s.gsub(%r{^/}, '')) if controller

            # Normalise action into a string
            @params[:action] = @params[:action].to_s if @params.has_key?(:action)

            # Sorts the identifiers so that modules that are at the bottom of the
            # inheritance chain come first (more specific modules first). Object
            # should always be last.
            identifiers = @identifiers.sort { |(first,_),(sec,_)| first <=> sec || 1 }

            @route = Route.new(@conditions.dup,@params, @blocks, :defaults => @defaults.dup, :identifiers => identifiers)

            if before = @options[:before] && @options[:before].last
              @route.register_at(Router.routes.index(before))
            else
              @route.register
            end
            self
          end