[Catalyst] Catalyst and ExtJS

Moritz Onken onken at houseofdesign.de
Mon Mar 16 17:53:17 GMT 2009


>
> 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



More information about the Catalyst mailing list