Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAnders Axelsen
3,471 PointsI can register, login and create a taco. - But why is the taco not displayed in /index?
Hi there!
As you can see in the database from the snapshot, there is a sound creation of a taco. There is no display of it, though.
What am I missing?
Kindly, Anders
2 Answers
Andreas cormack
Python Web Development Techdegree Graduate 33,011 PointsHi Anders
You not outputting any of the tacos attributes hence your not getting any output.
{% extends 'layout.html' %}
{% block content %}
<h2>Tacos</h2>
{% if tacos.count() %}
<table class="u-full-width">
<thead>
<tr>
<th>Protein</th>
<th>Cheese?</th>
<th>Shell</th>
<th>Extras</th>
</tr>
</thead>
<tbody>
{% for taco in tacos %}
<tr>
<!-- taco attributes here -->
<!-- your not outputting any attributes try the below -->
<td>{{taco.protein}}</td> <!-- and so on -->
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<!-- message for missing tacos -->
<p>no tacos yet</p>
{% endif %}
{% endblock %}
hope that helps
Anders Axelsen
3,471 PointsHi Andreas.
Boy, this helps. :-)
It's such a great feeling, learning more and more. Thank you for helping!