Just to make sure that I have all of this understood...
On the client side the code will look something like the following on the constructor:
save: =>
errors = validator.validateMeeting(@toJSON())
return super if not errors
# there were errors - handle them.
Similarly, on the server side we would do something like this:
validate: function(body, callback) {
var errors = validator.validateMeeting(body)
if( _.isEmpty(errors) ) {
}
// handle errors...
}
the object that we will get back will be something like based on the errors in the model/resource:
{
'title' : 'the title is needed.',
'email' : 'the email address format is not valid.'
}
and, on both the places you just include the validator module to get it working?