Hi
I am currently using mongoose, node.js , express. I need to fill up
multiple drop down menus from MongoDB.
I have successfully filled up one like this:
This calls the index (in app.js), which returns 1 collection.. but only the
one:
app.get('/', activityList.showActivities.bind(activityList));
activitylist.js
ActivityList.prototype = {
showActivities: function(req, res) {
point.find({}, function foundPoints(err, items) {
res.render('index2',{title: 'CapCredits' , points: items})
});
},
and in my index.jade:
form(action="/asdad", method="post")
select(name = "item[activity]")
each activity in activities
option(value='Test') #{activity.activityName}
How can I do this for several collections? I have two collections which I
want to fill two drop down menus with.
Is there any way I can use rest-calls like:
app.get('/otherMenu', activityList.showActivities.bind(activityList));
Any help is appreciated. Thanks
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.