use parent 'Catalyst::Controller::REST';
+=head1 CONFIGURATION
+
+See L<Catalyst::Action::Serialize/CONFIGURATION>. Note that the C<serialize>
+key has been deprecated.
+
+
=head1 SERIALIZATION
Catalyst::Controller::REST will automatically serialize your
=item * L<View>
Uses a regular Catalyst view. For example, if you wanted to have your
-C<text/html> and C<text/xml> views rendered by TT:
-
- 'text/html' => [ 'View', 'TT' ],
- 'text/xml' => [ 'View', 'XML' ],
+C<text/html> and C<text/xml> views rendered by TT, set:
-Will do the trick nicely.
+ __PACKAGE__->config(
+ map => {
+ 'text/html' => [ 'View', 'TT' ],
+ 'text/xml' => [ 'View', 'XML' ],
+ }
+ );
+
+Your views should have a C<process> method like this:
+
+ sub process {
+ my ( $self, $c, $stash_key ) = @_;
+
+ my $output;
+ eval {
+ $output = $self->serialize( $c->stash->{$stash_key} );
+ };
+ return $@ if $@;
+
+ $c->response->body( $output );
+ return 1; # important
+ }
+
+ sub serialize {
+ my ( $self, $data ) = @_;
+
+ my $serialized = ... process $data here ...
+
+ return $serialized;
+ }
+
=back