gov_uk_date_fields 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gov_uk_date_fields/form_fields.rb +9 -6
- data/lib/gov_uk_date_fields/version.rb +1 -1
- data/test/dummy/log/test.log +2005 -0
- data/test/form_fields_test.rb +31 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d76415df088fe52edcf253fcc668b728dc59cb9c
|
4
|
+
data.tar.gz: d70c36439edf22501a1d2ba151384c33d8988a79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f94c08662f9f987553f5dafb31384b1e4d23fe4263c632996bb7706cf4a9a4bc46484521270466f8612d318d36bd45a8a50453b28820dd1afef1ca77c1d86193
|
7
|
+
data.tar.gz: 1eb9dbc84c096d5cc2f8127ebd45a1e93dd26ee6e0eb95f7a01b51a780c062d91de4b019448be2b5f784e787fb2760a9d57c615568d5ffeb42fdc26937579371
|
@@ -42,7 +42,11 @@ module GovUkDateFields
|
|
42
42
|
raw_output.html_safe
|
43
43
|
end
|
44
44
|
|
45
|
-
|
45
|
+
private
|
46
|
+
|
47
|
+
def error_for_attr?
|
48
|
+
@object.errors.keys.include?(@attribute)
|
49
|
+
end
|
46
50
|
|
47
51
|
def fieldset_required?
|
48
52
|
@fieldset_required
|
@@ -66,11 +70,10 @@ module GovUkDateFields
|
|
66
70
|
end
|
67
71
|
|
68
72
|
def generate_fieldset_tag
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
end
|
73
|
+
result = "<fieldset"
|
74
|
+
result += %Q| id="#{@fieldset_id}"| unless @fieldset_id.nil?
|
75
|
+
result += %Q| class="error"| if error_for_attr?
|
76
|
+
result ++ ">"
|
74
77
|
end
|
75
78
|
|
76
79
|
def generate_end_fieldset
|