Handle a controller where the namespace is the empty string nicely.
[catagits/CatalystX-Routes.git] / lib / CatalystX / Routes.pm
index e7059a4..ccd2fa7 100644 (file)
@@ -112,6 +112,7 @@ sub _process_args {
             unless ( $part =~ s{^/}{} ) {
                 $part = join q{/},
                     $meta->name()->action_namespace('FakeConfig'), $part;
+                $part =~ s{^/}{};
             }
         }
 
@@ -317,7 +318,7 @@ Use this to declare an action class. By default, this will be
 L<Catalyst::Action::REST::ForBrowsers> for end points. For other parts of a
 chain, it simply won't be set.
 
-=head1 Path Generation
+=head1 PATH GENERATION
 
 All of the end point function (C<get>, C<post>, etc.) take a path as the first
 argument. By default, this will be used as the C<path_part> for the chain. You
@@ -336,6 +337,15 @@ root URI, C</>, as the root of the chain.
 By default, no arguments are specified for a chain's end point, meaning it
 will accept any number of arguments.
 
+=head1 CAVEATS
+
+When adding subroutines for end points to your controller, a name is generated
+for each subroutine based on the chained path to the subroutine. Some
+template-based views will automatically pick a template based on the
+subroutine's name if you don't specify one explicitly. This won't work very
+well with the bizarro names that this module generates, so you are strongly
+encouraged to specify a template name explicitly.
+
 =head1 BUGS
 
 Please report any bugs or feature requests to