On Fri, May 5, 2017 at 5:36 AM, Pierre VIGIER <[email protected]>
wrote:

> Am i getting something wrong? That was not my understanding from the
> documentation.


$r->get('/in_url/:controller/:action')->to( controler => 'first', action =>
'fallback' );

I'm pretty sure that according to the optional placeholders documentation
you wouldn't set controller and action in to(). Basically, you're able to
skip the to() because you've already set the controller and action in your
route (:controller stashes that part of the path into the reserved stash
value controller, and likewise for action). So you should be doing this, I
think:

$r->get('/in_url/:controller/:action');

And that will route appropriately for a GET request to, e.g.,
/in_url/first/fallback

So if'm right and if you're misunderstanding the documentation, then
perhaps the rest of your question is moot until you try with this new
interpretation. Let us know!

And yes, I think to() overrides the stash.

In the end, I don't think there's anything strange except that you're using
the :controller / :action trick yet declaring them explicitly with to().

-- 
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