X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FIndex.pm;h=dd8b0105fce90fc5caa14d917217eae1aced69f0;hb=22247e54ccd3fbdaf286e77304b96e61ecc43a0f;hp=3caeb5cac87ab6fbbe5e51fe7f24a6dafb5ea452;hpb=bcccee4e7d7b98c151448074e83c6201ef434476;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/DispatchType/Index.pm b/lib/Catalyst/DispatchType/Index.pm index 3caeb5c..dd8b010 100644 --- a/lib/Catalyst/DispatchType/Index.pm +++ b/lib/Catalyst/DispatchType/Index.pm @@ -15,22 +15,18 @@ See L. =head1 METHODS -=over 4 - -=item $self->match( $c, $path ) +=head2 $self->match( $c, $path ) =cut sub match { my ( $self, $c, $path ) = @_; - return if $path =~ m!/!; return if @{ $c->req->args }; - my $result = @{ $c->get_action( 'index', $c->req->path ) || [] }[-1]; + my $result = $c->get_action( 'index', $path ); - # Find default on namespace or super if ($result) { - $c->action( $result->[0] ); - $c->namespace( $c->req->path ); + $c->action($result); + $c->namespace( $result->namespace ); $c->req->action('index'); $c->req->match( $c->req->path ); return 1; @@ -38,8 +34,6 @@ sub match { return 0; } -=back - =head1 AUTHOR Sebastian Riedel, C