Skip to content

Commit

Permalink
more realistic route examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 27, 2012
1 parent 9c2380a commit 44a3603
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/Mojolicious/Routes/Route.pm
Expand Up @@ -378,7 +378,7 @@ Add a new child to this route.
Generate route matching any of the listed HTTP request methods or all. See
also the L<Mojolicious::Lite> tutorial for more argument variations.
$r->any('/foo/bar')->to('user#overview');
$r->any('/user')->to('user#whatever');
=head2 C<bridge>
Expand All @@ -394,7 +394,7 @@ Add a new bridge to this route as a nested child.
Generate route matching only C<DELETE> requests. See also the
L<Mojolicious::Lite> tutorial for more argument variations.
$r->delete('/foo/bar')->to('user#remove');
$r->delete('/user')->to('user#remove');
=head2 C<detour>
Expand Down Expand Up @@ -427,7 +427,7 @@ generated ones.
Generate route matching only C<GET> requests. See also the
L<Mojolicious::Lite> tutorial for more argument variations.
$r->get('/foo/bar')->to('user#show');
$r->get('/user')->to('user#show');
=head2 C<has_conditions>
Expand Down Expand Up @@ -468,7 +468,7 @@ The name of this route, defaults to an automatically generated name based on
the route pattern. Note that the name C<current> is reserved for refering to
the current route.
$r->get('/foo/bar')->to('user#show')->name('show_user');
$r->get('/user')->to('user#show')->name('show_user');
=head2 C<options>
Expand All @@ -477,7 +477,7 @@ the current route.
Generate route matching only C<OPTIONS> requests. See also the
L<Mojolicious::Lite> tutorial for more argument variations.
$r->options('/foo/bar')->to('user#preferences');
$r->options('/user')->to('user#overview');
=head2 C<over>
Expand All @@ -500,7 +500,7 @@ Parse a pattern.
Generate route matching only C<PATCH> requests. See also the
L<Mojolicious::Lite> tutorial for more argument variations.
$r->patch('/foo/bar')->to('user#update');
$r->patch('/user')->to('user#update');
=head2 C<post>
Expand All @@ -509,14 +509,16 @@ L<Mojolicious::Lite> tutorial for more argument variations.
Generate route matching only C<POST> requests. See also the
L<Mojolicious::Lite> tutorial for more argument variations.
$r->post('/user')->to('user#create');
=head2 C<put>
my $route = $r->put('/:foo' => sub {...});
Generate route matching only C<PUT> requests. See also the
L<Mojolicious::Lite> tutorial for more argument variations.
$r->put('/foo/bar')->to('user#create');
$r->put('/user')->to('user#replace');
=head2 C<render>
Expand Down Expand Up @@ -568,9 +570,9 @@ Stringify the whole route.
Generate bridge. See also the L<Mojolicious::Lite> tutorial for more argument
variations.
my $auth = $r->under('/foo')->to('user#auth');
$auth->get('/bar')->to('user#show');
$auth->put('/baz')->to('user#create');
my $auth = $r->under('/user')->to('user#auth');
$auth->get('/show')->to('#show');
$auth->post('/create')->to('#create');
=head2 C<via>
Expand Down

0 comments on commit 44a3603

Please sign in to comment.