Skip to content

Commit

Permalink
fixed format detection example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 28, 2013
1 parent 6cf96e4 commit 77498dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -425,12 +425,12 @@ routes and allows selective re-enabling.
# /foo -> {controller => 'foo', action => 'bar'}
# /foo.html -> undef
# /baz -> undef
# /baz.txt -> {controller => 'bar', action => 'baz', format => 'txt'}
# /baz.html -> {controller => 'bar', action => 'baz', format => 'html'}
# /baz.txt -> {controller => 'baz', action => 'yada', format => 'txt'}
# /baz.html -> {controller => 'baz', action => 'yada', format => 'html'}
# /baz.xml -> undef
my $inactive = $r->route(format => 0);
$inactive->route('/foo')->to('foo#none');
$inactive->route('/baz', format => [qw(txt html)])->to('bar#baz');
$inactive->route('/foo')->to('foo#bar');
$inactive->route('/baz', format => [qw(txt html)])->to('baz#yada');

=head2 Named routes

Expand Down

0 comments on commit 77498dc

Please sign in to comment.