in reply to Re: Why is mojolicious "routing to a callback" ?
in thread Why is mojolicious "routing to a callback" ?

Mmm, minimum, it is trivial with : Login.pm
package Myapp::Controller::Login; use Mojo::Base 'Mojolicious::Controller'; sub nolog { my $c = shift; $c->session(userid => 1); $c->redirect_to('menu'); } 1;
and nolog.htlm.rp :
%= form_for nolog => (method => 'POST') => begin <p> % if (param 'user') { <b>Erreur dans le mot de passe ou le nom d'utilisateur. Veuillez r +éessayer</b><br> % } Utilisateur :<br> %= text_field 'user' <br>Mot de passe :<br> %= password_field 'pass' <br> %= submit_button 'Login' </p> % end
and login.htlm.ep :
<p> ... </p>
Self contained, I do not know how to do (I am not with Mojolicious::Lite)..

Replies are listed 'Best First'.
Re^3: Why is mojolicious "routing to a callback" ?
by Anonymous Monk on Nov 25, 2015 at 11:34 UTC
    Does Class "MyApp::Controller::Login" is not a controller mean anything to you?

      Very good spot by Anonymous Monk!

      Most likely you are on Windows, or on a case-insensitive file system. That way, Perl loads a file Myapp/Controller/Login.pm even if you ask for MyApp/Controller/Login.pm (note the capital "A" in MyApp). Perl itself remains case-sensitive and looks for a class MyApp::Controller::Login, but your module only declares Myapp::Controller::Login with a lowercase "a".

      In the part of your setup that you haven't shown, you are mixing up Myapp and MyApp. Correct that and maybe things work differently.

      Mm, no sorry, I do not know why you refer to MyApp. My application is Myapp. I am on linux which is case sensitive.
      Sorry, my problem is not so simple...