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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.