Go to file
William Riley-Land f68e1d020b v1.0.1 Update to allow Mongoose 4 2015-05-07 21:30:13 -05:00
.gitignore Detach from baucis core. 2014-05-29 15:23:30 -05:00
LICENSE Initial commit 2014-05-29 15:36:37 -05:00
README.md v0.21.0 Update for candidate.6 2014-06-09 10:21:25 -05:00
config.json v1.0.0 Special thanks to sampsasaarela 2015-03-25 14:56:01 -05:00
index.js Detach from baucis core. 2014-05-29 15:23:30 -05:00
package.json v1.0.1 Update to allow Mongoose 4 2015-05-07 21:30:13 -05:00
tests.js v1.0.1 Update to allow Mongoose 4 2015-05-07 21:30:13 -05:00

README.md

baucis-vivify

A module for adding child controller paths

controller.vivify

This can be used to add paths under a controller. For example, a teacher schema might define an array of classrooms. controller.vivify lets embed the classrooms associated with a teacher at a URL like /teacher/123/classrooms.

var teachers = baucis.rest('teacher');
var classrooms = teachers.vivify('classrooms');

controller.parentPath

This can be used to note the path the schema defines that is associated with a vivified URL. For example, in the above example, if the classroom schema didn't use the field teacher to link to the teachers collection, but instead used a name of classTeachers:

var teachers = baucis.rest('teacher');
var classrooms = teachers.vivify('classrooms').parentPath('classTeachers');