json not rendering

For questions and postings not covered by the other forums
yssirhc
Posts: 1
Joined: Thu Jan 16, 2014 7:19 am

json not rendering

Postby yssirhc » Fri Jan 24, 2014 7:39 am

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?

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: json not rendering

Postby BeeJay » Fri Jan 24, 2014 7:45 am

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.

JohnP
Posts: 73
Joined: Mon Sep 28, 2009 8:41 am
Location: Christchurch

Re: json not rendering

Postby JohnP » Fri Jan 24, 2014 8:44 am

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..."

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: json not rendering

Postby BeeJay » Fri Jan 24, 2014 10:12 am

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.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 18 guests

cron