Answer the question
In order to leave comments, you need to log in
Jade, how to display the field of an object?
An array of objects is passed to the jade template, then the objects themselves are enumerated, which have the following structure:
{ _id: 53e91147ce282615c3f61423,
author: 'Автор Имя',
title: 'Заголовок',
date: '09.02.2013',
genre: 'жанр',
genre_id: 2 }
-var t = ""
pre #{verses[0]}
-for verse in verses
ul
-if(t != verse.author)
-var t = verse.author
span.author #{verse.author}
li
span
a(href='/verse/'+verse.id) #{verse.title}
span #{verse.genre_id}
a(href='/verse/find/'+verse.genre_id) #{verse.genre}
Answer the question
In order to leave comments, you need to log in
Try outputting verse.genreId. I'm not sure, but this is the first thing I would try, since this is the main difference from other attributes
_id: 53e91147ce282615c3f61423,
_id: '53e91147ce282615c3f61423',
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question