adammcarth/instance.js — pull request #7 by adammcarth (2014-10-05 07:36:42+00:00)
Title: Add validations support

Instance can now validate data for you before it is sent to the server. Validations go in the model declaration of your instance...

```javascript
Comment = new Instance({
validations: {
handle: { // name of the attribute/field to validate
starts_with: { // preset validation rule
value: "@",
fail: function() {
alert("Your handle must begin with @.");
}
}
}
}
});
```

A complete list of validations can be found on the Instance Wiki.