<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I've read [1] which gave me 2 methods to populate CRUD methods for all
tables, but both does not work here in Catalyst 5.<br>
<br>
In particular, I tried this:<br>
__PACKAGE__->set_action(<br>
'default', sub {<br>
my ($self, $c) = @_;<br>
for my $class
($c->comp("MyApp::M::CDBI")->loader->classes) {<br>
__PACKAGE__->action(<br>
$class->table => sub {<br>
my ($self, $c) = @_;<br>
$c->form( optional => [ $class ] );<br>
$c->forward($class);<br>
}<br>
);<br>
}<br>
},<br>
"",<br>
["Global"]<br>
);<br>
<br>
The error is:<br>
<code class="error">Caught exception "Can't call method "loader" on an
undefined value at lib/MyApp.pm line 14."</code><br>
<br>
Can anyone post the updated version which would work in Catalyst 5.33?
Thanks!<br>
<pre class="moz-signature" cols="72">--
Regards,
Alan
[1] <a class="moz-txt-link-freetext" href="http://lists.rawmode.org/pipermail/catalyst/2005-April/000174.html">http://lists.rawmode.org/pipermail/catalyst/2005-April/000174.html</a>
</pre>
</body>
</html>