in reply to Strange issue with Mojolicious
When you go to http://mojocasts.com/e3 turn on javascript so you can see the comments
solution is add return
post '/momcorp' => sub { my $self = shift; return $self->render(text => 'denied') if !$self->auth; return $self->render(text => 'Welcome to Momcorp!'); };
Think of it like this, its like having a $person object, and you do $person->name('bender') if ! $self->auth; $person->name('rodriguez');
Doesn't matter if the conditional is true, name is always changed afterwards :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Strange issue with Mojolicious
by walkingthecow (Friar) on May 01, 2013 at 11:39 UTC | |
by Anonymous Monk on May 01, 2013 at 11:54 UTC | |
by walkingthecow (Friar) on May 02, 2013 at 11:02 UTC | |
by Pizentios (Scribe) on May 01, 2013 at 14:15 UTC |
In Section
Seekers of Perl Wisdom