}
elsif (!defined $action->namespace) {
$error .= qq/Action has no namespace: cannot $opname() to a plain /
- .qq/method or component, must be a :Action or some sort./
+ .qq/method or component, must be an :Action of some sort./
}
elsif (!$action->class->can('_DISPATCH')) {
$error .= qq/Action cannot _DISPATCH. /
sub _invoke_as_component {
my ( $self, $c, $component, $method ) = @_;
+ #FIXME - Is this resolving needed/should it just return the instance
+ # directly
my $class = $self->_find_component_class( $c, $component ) || return 0;
+ my $component_instance = $c->component($class);
+ if (my $code = $component_instance->can('action_for')) {
+ my $possible_action = $component_instance->$code($method);
+ return $possible_action if $possible_action;
+ }
+
if ( my $code = $class->can($method) ) {
return $self->_method_action_class->new(
{