Created
July 2, 2016 14:39
-
-
Save akzhan/42543a2d7d9d838fa421de1a3161f41a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use JSON::XS (); | |
use DBIx::Class::ResultClass::HashRefInflator; | |
my $jsoner = JSON::XS->new->utf8(0)->allow_blessed; | |
sub country { | |
my $self = shift; | |
my $c = schema->resultset('Country')->search(undef, { | |
result_class => 'DBIx::Class::ResultClass::HashRefInflator', | |
}); | |
return $self->render_json( $jsoner->encode( $c->first ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Take a note at ->utf8(0) mutator.