http://www.perlmonks.org?node_id=1031549


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
    For some reason in ArchLinux with FireFox 20.0.1 and Shockwave Flash 11.2 r202, I am unable to actually play the video in the browser, or view the comments, even with JavaScript enabled. I've just been downloading the OGV files. Actually, I don't even see a comment section ;) I appreciate the help. That actually fixed the code. I wish I had seen the comments so I didn't look like a dork posting here.

      For some reason in ArchLinux with FireFox 20.0.1 and Shockwave Flash 11.2 r202, I am unable to actually play the video in the browser,

      Me neither, I watch the video on vimeo

      or view the comments, even with JavaScript enabled.

      Well, its disqus, so you have to enable javascript for disqus too -- firefox -safe-mode does a good job of enabling all javascripts and showing the comments :)

      That actually fixed the code. I wish I had seen the comments so I didn't look like a dork posting here.

      I don't think you did :) I think you looked like me :) I had to go out of my way to discover the comments section ; videos are great for showing whats possible, but they're practically never corrected for typos.

        I can watch them on vimeo as well, and I can now see the comments. Thanks again! :)
      Don't feel bad, i was bitten by the same issue. I often wondered if the cast was release before some changes in the under laying code.
      -Pizentios