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.
In reply to Need help working with a view in Catalyst by vendion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |