gov_uk_date_fields 1.0.3 → 1.0.4
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 +12 -0
- data/lib/gov_uk_date_fields/version.rb +1 -1
- data/test/dummy/app/models/employee.rb +0 -1
- data/test/dummy/log/test.log +2030 -0
- data/test/form_fields_test.rb +49 -40
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e002365d94c5556f99089cf351e5cba2fa5a3e2
|
4
|
+
data.tar.gz: c301e294c044baa1ca8cb3590658c8ff55149ddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6469764932adab92067b30a383f84e21e526f2e83c451558f2e7b99cc17be50f1a97c3e1eacf8f3bf856e1974e344714cefd70228fdd09c435901fb892b23b1f
|
7
|
+
data.tar.gz: 0e6e7132eaadece9234e77210405f9dafb8a009ae54fc9ea00be6648cfab553c4a61112b882eb3062a5da41d5bf4271c2f8d273636f8b224d950063c6f899a33
|
@@ -65,6 +65,7 @@ module GovUkDateFields
|
|
65
65
|
#{generate_fieldset_tag}
|
66
66
|
#{generate_legend_tag}#{@options[:legend_text]}</legend>
|
67
67
|
<div class="form-date">
|
68
|
+
#{generate_error_message}
|
68
69
|
<p class="form-hint" id="#{@attribute}-hint">#{@form_hint_text}</p>
|
69
70
|
|
|
70
71
|
end
|
@@ -88,6 +89,17 @@ module GovUkDateFields
|
|
88
89
|
end
|
89
90
|
end
|
90
91
|
|
92
|
+
def generate_error_message
|
93
|
+
result = ''
|
94
|
+
if error_for_attr?
|
95
|
+
result = "<ul>"
|
96
|
+
@object.errors[@attribute].each do |message|
|
97
|
+
result += %Q|<li><span class="error-message">#{message}</span></li>|
|
98
|
+
end
|
99
|
+
result ++ "</ul>"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
91
103
|
def generate_day_value
|
92
104
|
%Q|value="#{@day_value}"|
|
93
105
|
end
|