Merge branch 'master' of git://github.com/bobtfish/catalyst-action-rest
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / REST.pm
index c9d336e..f4e0a2f 100644 (file)
@@ -95,7 +95,10 @@ sub dispatch {
     my ($code, $name);
 
     # Common case, for foo_GET etc
-    if ($code = $controller->can($rest_method)) {
+    if ( $code = $controller->action_for($rest_method) ) {
+        $c->execute( $self->class, $self, @{ $c->req->args } );
+        return $c->forward( $code,  $c->req->args );
+     } elsif ($code = $controller->can($rest_method)) {
         # Exceute normal action
         $c->execute( $self->class, $self, @{ $c->req->args } );
         $name = $rest_method;