Skip to content

Commit

Permalink
slightly better example for nested routes
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 24, 2014
1 parent 890aa77 commit 1ec8587
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -281,13 +281,13 @@ endpoints of these nested routes can.
The stash is simply inherited from route to route and newer values override
old ones.

# /cats -> {controller => 'cats', action => 'index'}
# /cats/info -> {controller => 'cats', action => 'info'}
# /cats/dashboard -> {controller => 'cats', action => 'default'}
# /cats -> {controller => 'cats', action => 'index'}
# /cats/nyan -> {controller => 'cats', action => 'nyan'}
# /cats/lol -> {controller => 'cats', action => 'default'}
my $cats = $r->any('/cats')->to(controller => 'cats', action => 'default');
$cats->get('/')->to(action => 'index');
$cats->get('/info')->to(action => 'info');
$cats->get('/dashboard');
$cats->get('/nyan')->to(action => 'nyan');
$cats->get('/lol');

=head2 Special stash values

Expand Down

0 comments on commit 1ec8587

Please sign in to comment.