client_side_validations 8.0.1 → 8.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58bb726eb3177b25d2b654c6f876fd012927ed44
4
- data.tar.gz: 99f29f39c7336b9346a30978e8151bb846240022
3
+ metadata.gz: fed0feff4a513664392a746868722e04d5812444
4
+ data.tar.gz: b0c93e7e5a06f28666f63241b9a446378ce39376
5
5
  SHA512:
6
- metadata.gz: 1d1cf22aa5f09915484bf014081e3676856b2b3b65ac8db187340a58a7511eeb3a4d658ddf2731dee8e2d4ad30734fe4f1879ca519c8aa30b3fc3d9204892285
7
- data.tar.gz: c8b8c742525848a3779d7a7326791f520901dbf0dcabc54873284775e368464ce075a843c66dc57957cf16382dd4c7fe1ac59d6407fcd5cb2bb37ef8cd9e6449
6
+ metadata.gz: d92f7babb26e804be9a632593c70319dff02af7a9332f185eb6fbc9a894dc16195729eb7df31d50fea765d8c16a1b89f93f9337879347ace22654334e09b87d1
7
+ data.tar.gz: 6aef78c42b2ab083780fdcdc4379597b6a370e026b5ad7b3b96e84bf85fdc1591457a77c4b5b2bb15c5a0f4c5b3fafef76df31eeaf6d59f846fd80bd9aea51fb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.0.2 (2017-01-31)
4
+
5
+ * Under the hood improvements
6
+ * Update tests
7
+
3
8
  ## 8.0.1 (2017-01-26)
4
9
 
5
10
  * Under the hood improvements to the form helper
data/README.md CHANGED
@@ -85,6 +85,10 @@ following to your `app/assets/javascripts/application.js` file.
85
85
  //= require rails.validations
86
86
  ```
87
87
 
88
+ Note: If you are using [Turbolinks](https://github.com/turbolinks/turbolinks),
89
+ make sure that `rails.validations` is required **after** `turbolinks`, so
90
+ ClientSideValidations can properly attach its event handler.
91
+
88
92
  In your `FormBuilder` you only need to enable validations:
89
93
 
90
94
  ```erb
@@ -414,6 +418,17 @@ div.field_with_errors div.ui-effects-wrapper {
414
418
 
415
419
  Finally uncomment the `ActionView::Base.field_error_proc` override in `config/initializers/client_side_validations.rb`
416
420
 
421
+ ## Disable validators ##
422
+
423
+ If you want to disable some validators, set the `disabled_validators` config variable in `config/initializers/client_side_validations.rb`:
424
+
425
+ ```ruby
426
+ # Example: disable the presence validator
427
+ ClientSideValidations::Config.disabled_validators = [:presence]
428
+ ```
429
+
430
+ Note that the `FormBuilder` will automatically skip building validators that are disabled.
431
+
417
432
  ## Authors ##
418
433
 
419
434
  [Brian Cardarella](https://twitter.com/bcardarella)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ClientSideValidations
3
- VERSION = '8.0.1'.freeze
3
+ VERSION = '8.0.2'.freeze
4
4
  end
@@ -11,10 +11,10 @@
11
11
  # Note: client_side_validation requires the error to be encapsulated within
12
12
  # <label for="#{instance.send(:tag_id)}" class="message"></label>
13
13
  #
14
- # ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
15
- # unless html_tag =~ /^<label/
16
- # %{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe
14
+ # ActionView::Base.field_error_proc = proc do |html_tag, instance|
15
+ # if html_tag =~ /^<label/
16
+ # %(<div class="field_with_errors">#{html_tag}</div>).html_safe
17
17
  # else
18
- # %{<div class="field_with_errors">#{html_tag}</div>}.html_safe
18
+ # %(<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>).html_safe
19
19
  # end
20
20
  # end
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Client Side Validations - v8.0.1 (https://github.com/DavyJonesLocker/client_side_validations)
3
+ * Client Side Validations - v8.0.2 (https://github.com/DavyJonesLocker/client_side_validations)
4
4
  * Copyright (c) 2017 Geremia Taglialatela, Brian Cardarella
5
5
  * Licensed under MIT (http://opensource.org/licenses/mit-license.php)
6
6
  */
@@ -597,7 +597,7 @@
597
597
 
598
598
  window.ClientSideValidations.event = (window.Turbolinks != null) && window.Turbolinks.supported ? window.Turbolinks.EVENTS != null ? 'page:change' : 'turbolinks:load' : 'ready';
599
599
 
600
- $(document).bind(window.ClientSideValidations.event, function() {
600
+ $(document).on(window.ClientSideValidations.event, function() {
601
601
  ClientSideValidations.disableValidators();
602
602
  return $(ClientSideValidations.selectors.forms).validate();
603
603
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_side_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.1
4
+ version: 8.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-26 00:00:00.000000000 Z
12
+ date: 2017-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails