From 90af8c9b0f6fdb147b4508958a53b09a7dcfcede Mon Sep 17 00:00:00 2001 From: Krasimir Berov Date: Mon, 24 Jun 2013 01:00:41 +0300 Subject: [PATCH 1/3] Added rendering data example --- lib/Mojolicious/Guides/Rendering.pod | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Mojolicious/Guides/Rendering.pod b/lib/Mojolicious/Guides/Rendering.pod index 37425a1151..71b2b0ce4d 100644 --- a/lib/Mojolicious/Guides/Rendering.pod +++ b/lib/Mojolicious/Guides/Rendering.pod @@ -220,6 +220,11 @@ performed. $self->render(data => $bytes); +To render image data, like thumbnails, specify the format. + + my $bytes = Mojo::Asset::File->new(path => '/home/sri/foo.jpg'); + $self->render(data => $bytes->slurp, format =>'jpg'); + =head2 Rendering JSON The C stash value allows you to pass Perl data structures to the From 44a8a2e06defa4b7115c182b76fbcf0f2c8bc2ed Mon Sep 17 00:00:00 2001 From: Krasimir Berov Date: Mon, 2 Jun 2014 21:26:12 +0200 Subject: [PATCH 2/3] fixed example in SYNOPSIS --- lib/Mojolicious/Routes/Match.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Mojolicious/Routes/Match.pm b/lib/Mojolicious/Routes/Match.pm index 4edf11e49a..4957059d08 100644 --- a/lib/Mojolicious/Routes/Match.pm +++ b/lib/Mojolicious/Routes/Match.pm @@ -123,8 +123,8 @@ Mojolicious::Routes::Match - Find routes say $match->stack->[0]{action}; # Render - say $match->path_for; - say $match->path_for(action => 'baz'); + say $match->path_for->{path}; + say $match->path_for(action => 'baz')->{path}; =head1 DESCRIPTION From 0fe7215773168caf127b8ee2892ae2c6b049f07a Mon Sep 17 00:00:00 2001 From: Krasimir Berov Date: Mon, 2 Jun 2014 21:45:07 +0200 Subject: [PATCH 3/3] removed changes --- lib/Mojolicious/Guides/Rendering.pod | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/Mojolicious/Guides/Rendering.pod b/lib/Mojolicious/Guides/Rendering.pod index a0674a3fc0..cd4c3d0530 100644 --- a/lib/Mojolicious/Guides/Rendering.pod +++ b/lib/Mojolicious/Guides/Rendering.pod @@ -254,11 +254,6 @@ performed. $self->render(data => $bytes); -To render image data, like thumbnails, specify the format. - - my $bytes = Mojo::Asset::File->new(path => '/home/sri/foo.jpg'); - $self->render(data => $bytes->slurp, format =>'jpg'); - =head2 Rendering JSON The C stash value allows you to pass Perl data structures to the