[Catalyst] Database schema -- Can't locate object method "new" via package

Kevin Old kevinold at gmail.com
Fri Jun 16 03:40:58 CEST 2006


On 6/15/06, Sarah Berry <berry.sarah at gmail.com> wrote:
> I'm trying to learn how to use the database plugins, specifically DBIx. I
> set up my schemas to load from an existing database (hopefully), and now I
> want to test it out to see if I did that right. So I put the following lines
> into a page called dbixdemo.pm, in the "default" function:
>
>         my $schema = VieSEB::Schema::SLogDB->new();
>         my $crazy_attempt =
> $schema->resultset('SLogDB')->find(14);

Hi Sarah,

Make your calls in Controllers like this:

$c->model("VieSEB::Schema::SLogDB")->new();
$c->model("VieSEB::Schema::SLogDB")->search();
$c->model("VieSEB::Schema::SLogDB")->find();

Hope this helps,
Kevin

-- 
Kevin Old
kevinold at gmail.com



More information about the Catalyst mailing list