From the sails.js example,
//Person.js
var Person = { attributes: { firstName: 'STRING', lastName: 'STRING', age: { type: 'INTEGER', max: 150, required: true } birthDate: 'DATE', phoneNumber: { type: 'STRING', defaultsTo: '111-222-3333' } emailAddress: { type: 'email', // Email type will get validated by the ORM required: true } } };
Now, how can I add emailAddress to have home and office as inline fields?
Tried to do it like this:
emailAddress: { { work: { type: 'email', }, personal: { type: 'email', } } },
and
emailAddress: { attributes: { work: { type: 'email', }, personal: { type: 'email', } } },
both do not work. I get errors like "There are no rules for attributes" for the second case, "Unexpected token {" in the first case.
bunt
source share