diff options
author | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-09-26 02:24:39 +0000 |
---|---|---|
committer | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-09-26 02:24:39 +0000 |
commit | 9cf5bc0bb90b1ba0b0c1b97ff788ee08f124ff60 (patch) | |
tree | 492b7c9ee466148fabba84ca72b3e85942066393 /lib/Reaction/UI/Controller.pm | |
parent | 0b8430a4e7f8d4319d8ad59aeb00ac65734f1edf (diff) | |
download | reaction-9cf5bc0bb90b1ba0b0c1b97ff788ee08f124ff60.tar.gz reaction-9cf5bc0bb90b1ba0b0c1b97ff788ee08f124ff60.zip |
fixing the arrayref [controller, action] notation
Diffstat (limited to 'lib/Reaction/UI/Controller.pm')
-rw-r--r-- | lib/Reaction/UI/Controller.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Reaction/UI/Controller.pm b/lib/Reaction/UI/Controller.pm index aa1b8be..76b562e 100644 --- a/lib/Reaction/UI/Controller.pm +++ b/lib/Reaction/UI/Controller.pm @@ -53,17 +53,17 @@ sub redirect_to { #the confess calls could be changed later to $c->log ? my $action; - if(!ref $to){ - $action = $self->action_for($to); - confess("Failed to locate action ${to} in " . blessed($self)) unless $action; - } - elsif( blessed $to && $to->isa('Catalyst::Action') ){ - $action = $to; - } elsif(ref $action eq 'ARRAY' && @$action == 2){ #is that overkill / too strict? - $action = $c->controller($to->[0])->action_for($to->[1]); - confess("Failed to locate action $to->[1] in $to->[0]" ) unless $action; + my $reftype = ref($to); + if( $reftype eq '' ){ + $action = $self->action_for($to); + confess("Failed to locate action ${to} in " . blessed($self)) unless $action; + } elsif($reftype eq 'ARRAY' && @$to == 2){ #is that overkill / too strict? + $action = $c->controller($to->[0])->action_for($to->[1]); + confess("Failed to locate action $to->[1] in $to->[0]" ) unless $action; + } elsif( blessed $to && $to->isa('Catalyst::Action') ){ + $action = $to; } else{ - confess("Failed to locate action from ${to}"); + confess("Failed to locate action from ${to}"); } $cap ||= $c->req->captures; |