vendion has asked for the wisdom of the Perl Monks concerning the following question:
I trying to get into development with Catalyst and don't know if this is the best place for questions on Catalyst or not but if someone here is able to help me out I would be greatfull.
I am trying to pull data out of my database and display it in my View (Template Toolkit), farily common right? My model is configured to work with my PostgreSQL server and I have my controller set as far as I can tell but the view doesn't display anything.
Here is my sub I am working with from my controller:
sub list :Local { my ($self, $c) = @_; $c->stash(users => [$c->model('DB::tech')->all]); $c->stash(template => 'admin/list.tt2'); }
See below for updated code
This is my code for my view
[% META title = 'System Users List' -%] <table> <tr><th>ID</th><th>First Name</th><th>Last Name</th><th>Email</th><th> +Phone</th><th>Management Rating</th><th>Comments</th><th>Date</th><th +>Is Admin</th></tr> [% FOREACH tech in tech -%] <tr> <td>[% users.id %]</td> <td>[% users.firstname %]</td> <td>[% users.lastname %]</td> <td>...</td> ....snip... </tr> [% END -%] </table>
In the debug output from DBIC_TRACE I can see the query
SELECT me.uniqid, me.id, me.firstname, me.lastname, me.email, me.phone, me.managementrating, me.managementcomments, me.date, me.ismanagement FROM tech me;
That looks correct to me, I'm sure this issue is being casused by something small.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need help working with a view in Catalyst
by chromatic (Archbishop) on Mar 12, 2011 at 22:08 UTC | |
|
Re: Need help working with a view in Catalyst
by Your Mother (Archbishop) on Mar 12, 2011 at 22:13 UTC | |
by vendion (Scribe) on Mar 22, 2011 at 23:52 UTC | |
by Your Mother (Archbishop) on Mar 23, 2011 at 04:49 UTC | |
by vendion (Scribe) on Mar 24, 2011 at 16:38 UTC | |
by vendion (Scribe) on Mar 25, 2011 at 00:17 UTC | |
|