Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Why is mojolicious "routing to a callback" ?

by Corion (Patriarch)
on Nov 25, 2015 at 09:29 UTC ( [id://1148591]=note: print w/replies, xml ) Need Help??


in reply to Why is mojolicious "routing to a callback" ?

Can you maybe show us a small, self-contained example that we can use to replicate your problem? Something that has a minimal login/menu.html.ep and the minimal code to reproduce?

Replies are listed 'Best First'.
Re^2: Why is mojolicious "routing to a callback" ?
by pcouderc (Monk) on Nov 25, 2015 at 11:20 UTC
    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)..
      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...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1148591]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-03-29 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found