Fixed the args passed to default
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Default.pm
index ff1f83e..9cd82bf 100644 (file)
@@ -31,6 +31,8 @@ sub match {
         $c->action( $result->[0] );
         $c->namespace( $c->req->path );
         $c->req->action('default');
+        # default methods receive the controller name as the first argument
+        unshift @{ $c->req->args }, ( split /\//, $result->[0] )[0];
         $c->req->match('');
         return 1;
     }