Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated readme

  • Loading branch information...
commit ac908d1542cdaaae40940f6a273bede764b126b9 1 parent 7b84836
Thomas Pedersen authored

Showing 2 changed files with 10 additions and 4 deletions. Show diff stats Hide diff stats

  1. 12  README.md
  2. 2  buster.js
12  README.md
Source Rendered
@@ -161,7 +161,7 @@ If you have set the global selector to `class`, you can of course set the select
161 161
 
162 162
 	var SomeModel = Backbone.Model.extend({
163 163
 	  validation: {
164  
-	    name: {
  164
+	    termsOfUse: {
165 165
 		  acceptance: true
166 166
 		}
167 167
 	  }
@@ -293,7 +293,7 @@ See the [wiki](https://github.com/thedersen/backbone.validation/wiki) for more d
293 293
 
294 294
 ### Adding custom validators
295 295
 
296  
-If you have custom validation logic that are used several places in your code, you can extend the validators with your own custom ones. And if you don't like the default implementation of one of the built-ins, you can override it.
  296
+If you have custom validation logic that are used several places in your code, you can extend the validators with your own. And if you don't like the default implementation of one of the built-ins, you can override it.
297 297
 
298 298
 	_.extend(Backbone.Validation.validators, {
299 299
       myValidator: function(value, attr, customValue, model) {
@@ -320,7 +320,7 @@ The validator should return an error message when the value is invalid, and noth
320 320
 
321 321
 ### Adding custom patterns
322 322
 
323  
-If you have custom patterns that are used several places in your code, you can extend the patterns with your own custom ones. And if you don't like the default implementation of one of the built-ins, you can override it.
  323
+If you have custom patterns that are used several places in your code, you can extend the patterns with your own. And if you don't like the default implementation of one of the built-ins, you can override it.
324 324
 
325 325
 	_.extend(Backbone.Validation.patterns, {
326 326
 	  myPattern: /my-pattern/,
@@ -342,6 +342,12 @@ If you don't like the default error messages there are two ways of customizing t
342 342
 	_.extend(Backbone.Validation.messages, {
343 343
 		required: 'This field is required'
344 344
 	});
  345
+	
  346
+The message can contain placeholders for arguments that will be replaced:
  347
+
  348
+* `{0}` will be replaced with the name of the attribute being validated
  349
+* `{1}` will be replaced with the allowed value configured in the validation (or the first one in a range validator)
  350
+* `{2}` will be replaced with the second value in a range validator
345 351
 
346 352
 # Release notes
347 353
 
2  buster.js
@@ -8,7 +8,7 @@ config['Default'] = {
8 8
 		'lib/backbone.js', 
9 9
 		'lib/backbone.modelbinding.js', 
10 10
 		'tests/support/default.js',
11  
-		'backbone.validation.js'
  11
+		'backbone.validation.min.js'
12 12
 	],
13 13
     tests: [
14 14
 		'tests/**/*.js'

0 notes on commit ac908d1

Please sign in to comment.
Something went wrong with that request. Please try again.