Hi Tekki

search 1works but not search 2 so i guess I'm doing something wrong there.
The debug helper works though and the render tries to render the correct
template but it throws the error that $mytest needs to be declared.
sub search1 {
    my $self = shift;

   $self->render(template =>,'stockitems/search',  mytest => 'my test');
}

sub search2 {
    my $self = shift;

 $self->stockitems->search_p('*')->then(sub {
      my $results = shift;
      $self->debug('we have searched successfully');
      $self->render(template =>,'stockitems/search',  mytest => 'my test');
    })->catch (sub {
      my $err = shift;

      $self->debug($err);
      $self->debug('we have some error');
      $self->render(template =>,'stockitems/search',  mytest => 'Errors');
    })->wait;;

}


Thanks for any input to what I'm doing wrong.


Best Regards
Jan

2018-04-09 14:31 GMT+02:00 Tekki <te...@tekki.ch>:

> As long as you get an error message, nothing is broken. ;)
> Mojolicious tries to render the correct template, so the error must be
> somewhere on the way to it.
>
> Am Montag, 9. April 2018 12:40:13 UTC+2 schrieb Jan Eskilsson:
>>
>> I start to believe that my installation is somehow broken, I also have
>> other strange behaviour. I will reinstall to see if it helps
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Titles mean nothing.  The one with a servant's heart is the leader.

Please consider the environment before you print this email.

All incoming and outgoing emails and any attachments are subjected to a
virus scanner and are believed to be free of any virus, or any other defect
which might affect any computer or IT system into which they are received
and opened. Therefore, it is the responsibility of the recipient to ensure
that they are virus free and no responsibility is accepted by Jan Eskilsson
 for any loss or damage arising in any way from receipt or use thereof.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to