Merge branch 'master' of git://github.com/bobtfish/catalyst-action-rest
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / REST.pm
index dc34289..f4e0a2f 100644 (file)
@@ -17,7 +17,7 @@ use Catalyst::Controller::REST;
 
 BEGIN { require 5.008001; }
 
-our $VERSION = '0.75';
+our $VERSION = '0.76';
 $VERSION = eval $VERSION;
 
 sub new {
@@ -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;