client_side_validations 20.0.1 → 20.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 947a8c3e977a52425b7d60ca031c38ba6aa0e22534704859cf10330f42fc7c64
|
4
|
+
data.tar.gz: 120c000d994694b6cf98ceb28ed40507a43e28132563a1d03f43dde3bcf9a272
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82dadc40eac82e9b38fca023d4732a8f6a3d835bc29f5b41ffa68345b8366a797c3a224ac0af0c8f50bc0067361c527741cf43bbf0d07779309134914c80231e
|
7
|
+
data.tar.gz: 125ae43cbb60726874f2ddba6aec7f355ebfb4e5a0e6cf7218cb42b9abb55d100e03f464a835b0b7490bc9232d55f73361cb759a0a3533b758ee0464b87b8717
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 20.0.2 / 2021-12-22
|
4
|
+
|
5
|
+
* [BUGFIX] Fix Rails 7.0 compatibility ([#869](https://github.com/DavyJonesLocker/client_side_validations/issues/869))
|
6
|
+
|
3
7
|
## 20.0.1 / 2021-12-22
|
4
8
|
|
5
9
|
* [BUGFIX] Fix missing HTTP method ([#867](https://github.com/DavyJonesLocker/client_side_validations/issue/867))
|
@@ -29,8 +29,8 @@ module ClientSideValidations
|
|
29
29
|
def client_side_form_settings(_options, form_helper)
|
30
30
|
{
|
31
31
|
type: self.class.to_s,
|
32
|
-
input_tag: form_helper
|
33
|
-
label_tag: form_helper
|
32
|
+
input_tag: error_field(form_helper, :span, 'input_tag'),
|
33
|
+
label_tag: error_field(form_helper, :label, 'label_tag')
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
@@ -109,6 +109,12 @@ module ClientSideValidations
|
|
109
109
|
|
110
110
|
private
|
111
111
|
|
112
|
+
def error_field(form_helper, tag, id)
|
113
|
+
form_helper.instance_exec form_helper.content_tag(tag, nil, id: id),
|
114
|
+
Struct.new(:error_message, :tag_id).new([], ''),
|
115
|
+
&form_helper.class.field_error_proc
|
116
|
+
end
|
117
|
+
|
112
118
|
def build_validation_options(method, options = {})
|
113
119
|
return unless @options[:validate]
|
114
120
|
|
@@ -9,6 +9,9 @@
|
|
9
9
|
|
10
10
|
# Uncomment the following block if you want each input field to have the validation messages attached.
|
11
11
|
#
|
12
|
+
# Alternatively, for a cleaner approach, it is possible to set
|
13
|
+
# `config.action_view.field_error_proc` in the application configuration
|
14
|
+
#
|
12
15
|
# Note: client_side_validation requires the error to be encapsulated within
|
13
16
|
# <label for="#{instance.send(:tag_id)}" class="message"></label>
|
14
17
|
#
|