Skip to content

Instantly share code, notes, and snippets.

@swanson
Created November 8, 2010 02:19
Show Gist options
  • Save swanson/667308 to your computer and use it in GitHub Desktop.
Save swanson/667308 to your computer and use it in GitHub Desktop.
//Good! (well, better at least...)
app.get('/edit', function(req, res){
var stored_items = [];
//pull some data out of mongo
Announcement.fetch_active().all(function(results) {
for (i in results) {
stored_items.push(results[i].body);
}
//pass the results to the template
res.render('edit.jade', {
locals: {
title: 'Edit Announcements',
items: stored_items
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment