Hi Scott,
thank for your reply, in having a go at using Catalyst::View::JSON i
keep running into the
"... encountered object
'MyApp::Model::DB::Experiment=HASH(0xe8ac4c)', but neither
allow_blessed nor convert_blessed settings ... "
error. I'm getting data from DBIC but can't figure out how to get
that into Catalyst::View::JSON. The "hello world" example works
fine, but when trying to adapt this i run into trouble
sub hello : Local {
my($self, $c) = @_;
# $c->stash->{message} = 'Hello World!';
$c->stash->{books} = [$c->model('DB::Books')->all]; ### this
doesn't work....
$c->forward('MyApp::View::JSON');
}
any pointers into the right syntax/approach here would be greatly
appreciated. I presume i have to write some kind of JSON encoder for
the data coming out of $c->model('DB::Books')->all?
thanks again for your help
Hi,
You can access the raw data through $row->{_column_data}. But this is
not recommended because it doesn't call any inflators.
try
$c->stash->{books} = [map { $_->{_column_data} } $c-
>model('DB::Books')->all];
Moritz
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/