Skip to content

Commit

Permalink
validation docs are better
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbmeyer committed Oct 20, 2011
1 parent 94991fb commit a464cdf
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions model/validations/validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,28 @@ $.extend($.Model, {
validate: validate,

/**
* @attribute validationMessages
* @attribute jQuery.Model.static.validationMessages
* @parent jquery.model.validations
* The default validation error messages that will be returned by the builtin
* validation methods. These can be overwritten by assigning new messages
* to $.Model.validationMessages.<message> in your application setup.
*
* The following messages are available:
* * format
* * inclusion
* * lengthShort
* * lengthLong
* * presence
* * range
* The following messages (with defaults) are available:
*
* * format - "is invalid"
* * inclusion - "is not a valid option (perhaps out of range)"
* * lengthShort - "is too short"
* * lengthLong - "is too long"
* * presence - "can't be empty"
* * range - "is out of range"
*
* It is important to ensure that you steal jquery/model/validations
* before overwriting the messages, otherwise the changes will
* be lost once steal loads it later.
*
* ## Example
*
* $.Model.validationMessages.format = "is invalid dummy!"
*/
validationMessages : {
format : "is invalid",
Expand Down

0 comments on commit a464cdf

Please sign in to comment.