Reputation: 9132
I want to use 'ip' validation but I tried something like
attributes: {
type: 'string',
ip: true
}
but it always refuse when I gives 192.168.2.1 or any other ip.
I know there is a list of available in this page http://sailsjs.org/#!documentation/models
However, they don't explain how to use each one. If anyone knows other good document or any rules on usage, please!
Upvotes: 0
Views: 149
Reputation: 24948
First you need to give your attribute a name. Then to use the IP validator, set the type
of the attribute to ip
:
attributes: {
ipAddr: {
type: 'ip'
}
}
Upvotes: 1