Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
better examples for reattaching routes
  • Loading branch information
kraih committed May 3, 2012
1 parent 973b6c0 commit dc14f6b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Mojolicious/Routes/Route.pm
Expand Up @@ -362,7 +362,7 @@ Construct a new L<Mojolicious::Routes::Route> object.
Add a new child to this route.
# Move route around
# Reattach route
$r->add_child($r->find('foo'));
=head2 C<any>
Expand Down Expand Up @@ -401,12 +401,14 @@ L<Mojolicious::Lite> tutorial for more argument variations.
$r = $r->detach;
Detach route from parent. Detached routes can be reattached to a new parent
with C<add_child>.
Detach route from parent.
# Remove route
$r->find('foo')->detach;
# Reattach route to new parent
$r->find('foo')->add_child($r->find('bar')->detach);
=head2 C<detour>
$r = $r->detour(action => 'foo');
Expand Down

0 comments on commit dc14f6b

Please sign in to comment.