Merge branch 'authentication' of github.com:tla/stemmatology
[scpubgit/stemmatology.git] / stemmaweb / lib / stemmaweb / View / JSON.pm
index e8a9284..347c034 100644 (file)
@@ -3,6 +3,16 @@ package stemmaweb::View::JSON;
 use strict;
 use base 'Catalyst::View::JSON';
 
+use JSON::XS ();
+
+sub encode_json {
+       my( $self, $c, $data ) = @_;
+       my $json = JSON::XS->new->utf8->convert_blessed(1);
+       $json->encode( $data );
+}
+
+1;
+
 =head1 NAME
 
 stemmaweb::View::JSON - Catalyst JSON View
@@ -23,7 +33,3 @@ Tara Andrews
 
 This library is free software, you can redistribute it and/or modify
 it under the same terms as Perl itself.
-
-=cut
-
-1;