Navigation Menu

Skip to content

Commit

Permalink
mention more details
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 25, 2015
1 parent cc2ba7c commit fe37250
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -586,8 +586,9 @@ allowed formats.
# /foo.xml -> {controller => 'foo', action => 'bar', format => 'xml'}
$r->get('/foo' => [format => [qw(rss xml)]])->to('foo#bar');

Or you can just disable format detection, which gets inherited by nested routes
and allows selective re-enabling.
Or you can just disable format detection, which gets inherited by nested
routes, and then re-enable it selectively on demand with restrictive
placeholders.

# /foo -> {controller => 'foo', action => 'bar'}
# /foo.html -> undef
Expand Down
9 changes: 5 additions & 4 deletions lib/Mojolicious/Guides/Tutorial.pod
Expand Up @@ -547,8 +547,9 @@ allows nesting of routes generated with L<Mojolicious::Lite/"under">.

=head2 Formats

Formats can be automatically detected from file extensions, they are used to
find the right template and generate the correct C<Content-Type> header.
Formats can be automatically detected from file extensions like C<.html>, they
are used to find the right template and generate the correct C<Content-Type>
header.

use Mojolicious::Lite;

Expand All @@ -573,8 +574,8 @@ find the right template and generate the correct C<Content-Type> header.
@@ detected.txt.ep
TXT was detected.

The default format is C<html>, restrictive placeholders can be used to limit
possible values.
The default format is C<html>, and restrictive placeholders can be used to
limit possible values.

use Mojolicious::Lite;

Expand Down

0 comments on commit fe37250

Please sign in to comment.