On Fri, Jan 15, 2016 at 4:24 PM, Marlik Almighty <[email protected]> wrote:
> $r->get('/:category/:id')->to('site#show_id');
>
> I want to select all articles from category so:
>
> http://domen.com/category/
>
You need to set a default id since your URL isn't supplying one:
$r->get('/:category/:id')->to('site#show_id', {id => ''});
See Routing, Optional Placeholders
<http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Optional-placeholders>
--
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.