Skip to content

Commit

Permalink
added a few render examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 3, 2014
1 parent 75e5075 commit 21cb31a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -687,6 +687,16 @@ controller and action or route name will be generated with
L<Mojolicious::Renderer/"template_for">, all additional values get merged into
the L</"stash">.
# Render characters
$c->render(text => 'I ♥ Mojolicious!');
# Render binary data
use Mojo::JSON 'j';
$c->render(data => j({test => 'I ♥ Mojolicious!'}));
# Render JSON
$c->render(json => {test => 'I ♥ Mojolicious!'});
=head2 render_exception
$c = $c->render_exception('Oops!');
Expand Down

0 comments on commit 21cb31a

Please sign in to comment.