Skip to content

Commit

Permalink
more advanced route example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 5, 2012
1 parent c9d3579 commit 320494e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -964,18 +964,15 @@ generated content and content that is streamed directly from files.
$self->res->body($compressed)->headers->content_encoding('gzip');
};

get '/' => sub {
my $self = shift;
$self->render(template => 'hello', gzip => 1);
};
get '/' => {template => 'hello', title => 'Hello', gzip => 1};

app->start;
__DATA__

@@ hello.html.ep
<!DOCTYPE html>
<html>
<head><title>Hello</title></head>
<head><title><%= title %></title></head>
<body>Compressed content.</body>
</html>

Expand Down

0 comments on commit 320494e

Please sign in to comment.