SailsJS - Blueprint "add" associations
I would like to use Blueprint routes to use add-in and remove-at association routes.
I have two models:
stocks:
module.exports = {
attributes: {
keys: {
collection: 'key',
via: 'stockpile'
}
}
};
and the key:
module.exports = {
attributes: {
name: {
type: 'string',
defaultsTo: 'noname'
},
stockpile: {
model: 'stockpile'
}
}
};
I have a stock with id 1 and a key with id 1. But when I do:
Post / stock / 1 / keys / 1
I have a 404 error. REST routes are enabled.
What am I doing wrong?
Regards, Sylvain
+3
source to share