Page 1 of 1

json not rendering

Posted: Fri Jan 24, 2014 7:39 am
by yssirhc
In index.js:

Code: Select all

app.get('/admin', function (req, res, next) { var studentData = { students: [ { puid: '56', name: 'Dr. Heathcliff Huxtable', email: 'cosby@show.com', picture: '', studentPerformance: { correct: 9, notAnswered: 0, incorrect: 1 } } ] }; res.render('analytics_home', { studentData: studentData }); });
In the jade file:

Code: Select all

h2 Overall Performance h4 Active Students ul#studentList.dd-list each student in studentData.students li.dd-item(id='student' + '#{student.puid}') .dd-handle.thickLI img.profilePic(src='#{student.picture}', alt='Student Pic') | #{student.name} br | #{student.email} a.btn.btn-sm.btn-primary.viewStudent(href='/admin/student/#{student.puid}') View .progress(style='width: 60%; float: right;') .progress-bar.progress-bar-success .progress-bar.progress-bar-warning .progress-bar.progress-bar-danger
In the command prompt I get back "studentData is not defined" and the page is unavailable. What am I doing wrong?

Re: json not rendering

Posted: Fri Jan 24, 2014 7:45 am
by BeeJay
It seems like you may be posting your question on the wrong boards. These boards are for the JADE Object Oriented Database and Interactive Development Environment - see www.jade.co.nz/jade for further details.

Cheers,
BeeJay.

Re: json not rendering

Posted: Fri Jan 24, 2014 8:44 am
by JohnP
BeeJay, maybe it should say that at the top of the page? "JADE - the Object Oriented Database and Interactive Development Environment " under the line "Forums for the discussion..."

Re: json not rendering

Posted: Fri Jan 24, 2014 10:12 am
by BeeJay
Unfortunately there's only the two lines available to put text for phpBB based forums.

Site name - currently set to "Jade Forums"

Site description - currently set to "Forums for the discussion of Jade technologies and solutions"

Also, I'm neither the Admin nor the owner of these forums, so I couldn't really change this text even if I wanted to to try to reduce the likelihood of off-topic postings.

Cheers,
BeeJay.