How to provide custom model validation message in Sails.js?
How to provide Custom Model Validation message in Sails.js?
The validation messages returned by Sails.js is not user friendly so I wanted to provide a custom validation message for rules like required, minLength etc... but don't really know how. It's not in the docs and I also checked the docs of Anchor.js w/c is the validator used by Sails but its also not there.
Haven't got a response last week so I implemented my own solution, wanted to share it since it might be useful for others - How I use custom validation messages in Sails.js
Another alternative and better way is to use the solution of @Rifat found in the comments below :)
Another very good alternative (credits to: sfb_ ) - https://gist.github.com/basco-johnkevin/8436644
Since Sails.js doesn't yet support using custom model validation messages, we can use these solutions:
1) @johnkevinmbasco's solution
2) @sfb_'s solution
3) @rifats solution