I have a model and collection defined in Backbone like so:
$(document).ready(function () {
DeviceModel = Backbone.Model.extend({
urlRoot: '/ajax/mvcDevices',
validationRules: {
name: [{ rule: 'required'}],
mac: [
{ rule: 'required' },
{ rule: 'isMacAddress' }
],
speed: [{ rule: 'required'}]
},
preprocess: {
name: ['clean', 'trim'],
speed: ['clean', 'trim']
}
});
DeviceCollection = Backbone.Collection.extend({
url: '/ajax/mvcDevices',
Model: DeviceModel
});
});
However, when working with these models inside a Collection, the custom fields listed are all not defined. What have I missed here?
Model : DeviceModel=>model : DeviceModel? (lowercasem) - WiredPrairie