2 # Catlyst::Action::Serialize::JSON.pm
3 # Created by: Adam Jacob, Marchex, <adam@hjksolutions.com>
4 # Created on: 10/12/2006 03:00:32 PM PDT
8 package Catalyst::Action::Serialize::JSON;
13 use base 'Catalyst::Action';
14 use JSON qw(encode_json);
18 my ( $controller, $c ) = @_;
21 $controller->{'serialize'} ?
22 $controller->{'serialize'}->{'stash_key'} :
23 $controller->{'stash_key'}
27 $output = encode_json( $c->stash->{$stash_key} );
32 $c->response->output( $output );