Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix for deep nested controllers

  • Loading branch information...
commit 514fc1c96c65fd3b7aa56e216572ed5eddc4e853 1 parent 0073a32
authored August 30, 2010
2  lib/WebNano/Controller.pm
@@ -29,7 +29,7 @@ sub render {
29 29
 sub self_path{
30 30
     my $self = shift;
31 31
     my $path = ref $self;
32  
-    $path =~ s/.*::Controller(::)?//;
  32
+    $path =~ s/.*::Controller(?=(::|$))//;
33 33
     $path =~ s{::}{/};
34 34
     return $path . '/';
35 35
 }
3  t/10.main.t
@@ -54,6 +54,9 @@ test_psgi(
54 54
 #        $res = $cb->(GET "/DoesNotCompile/");
55 55
 #        is( $res->code, 500, '500 for controller that does not compile' );
56 56
 #        in some circumstances the above code dies instead of issuing a 500
  57
+
  58
+        $res = $cb->(GET "Deep/Nested/some");
  59
+        is( $res->content, "This is 'some_action' in 'MyApp::Controller::Deep::Nested'" );
57 60
      } 
58 61
 );
59 62
 

0 notes on commit 514fc1c

Please sign in to comment.
Something went wrong with that request. Please try again.