If you sent JSON data, try dump this var:
# in controller
sub some_subs {
  my $c = shift;
  my $params = $c->req->json;
 say $c->dumper($params);
}

вторник, 17 мая 2016 г., 21:26:52 UTC+3 пользователь Billy Patton написал:
>
> I know now that when you hit a submit on a web page it is picked up by 
> mojo controller.
> I've tried running perl -d:Trace but that creates millions of lines.
> THe problem I'm having is that I have a URL like :
> https://my_app.com/tn/search
> Which the should be tn and the action be the search.
> I edited /usr/local/lib/perl5/site_perl/5.16.3/Mojolicious/Routes.pm
> in sub routine _controller I put a $log->debug( $self);
> In my debug file I get the following line :
> [Tue May 17 12:57:17 2016] [debug] POST "/ws/tn/search"
>
> As part of the dump I get :
> [Tue May 17 12:57:17 2016] [debug] 
> /usr/local/lib/perl5/site_perl/5.16.3/Mojolicious/Routes.pm:150 : self : 
> $VAR1 = bless( {
>                  'loaded' => {
> :
>                                    'host' => sub { "DUMMY" }
>                                  },
>                  'namespaces' => [
>                                    'App::Controller',
>                                    'App'
>                                  ],
>                  'cache' => bless( {
>                                      'max_keys' => 100,
>                                      'queue' => [
>                                                   'POST:/ws/tn/search:0'
>                                                 ],
>                                      'cache' => {
>                                                   'POST:/ws/tn/search:0' 
> => {
>                                                                           
>   'stack' => [
>                                                                           
>                {
>                                                                           
>                  'controller' => 'auth',
>                                                                           
>                  'action' => 'user'
>                                                                           
>                },
>                                                                           
>                {
>                                                                           
>                  'controller' => 'ws',
>                                                                           
>                  'target' => 'search',
>                                                                           
>                  'action' => 'tn'
>                                                                           
>                }
>                                                                           
>              ],
>                                                                           
>   'endpoint' => $VAR1->{'children'}[0]{'children'}[4]
>                                                                           }
>                                                 }
>                                    }, 'Mojo::Cache' )
>                }, 'Mojolicious::Routes' );
>
>
> I'm trying to determine where the ws gets introduced as the controller 
> where it should be tn.
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to