cm-admin 2.4.5 → 2.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/form_helper.rb +6 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73688c5bd0feeb5e298c38aff4f27bfd25713415fe1966e3ceb4aa0904d0626d
|
4
|
+
data.tar.gz: 1e8159e651b679a797a8b22c7041ca042290b19f9e8bee708e123b57cde0734b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f83a656a89400a1cf26767d3eccdc79fc7f19af1c88cdcc24b408a9e8be33e0e66580594361a4bbee5009f2b56e717e250efcef813b3ddc24a7c961c6226633e
|
7
|
+
data.tar.gz: e0c9ebf9c99e8fee1524dc580eda47073c75e17dedb6620fe24d26ae11c86cef424501d57645fbf363ce8bc9947e64d97f45a9c530232743fa78e8e75fe449ff
|
data/Gemfile.lock
CHANGED
data/lib/cm_admin/version.rb
CHANGED
@@ -111,9 +111,9 @@ module CmAdmin
|
|
111
111
|
def set_form_field(resource, form_obj, field)
|
112
112
|
return unless field.display_if.call(form_obj.object)
|
113
113
|
return create_alert(field, form_obj.object) if field.is_a?(CmAdmin::Models::Alert)
|
114
|
-
|
114
|
+
|
115
115
|
is_required = is_field_presence_validated?(form_obj, field)
|
116
|
-
|
116
|
+
|
117
117
|
content_tag(:div, class: field.col_size ? "col-#{field.col_size}" : 'col') do
|
118
118
|
if field.input_type.eql?(:hidden)
|
119
119
|
concat input_field_for_column(form_obj, field, is_required:)
|
@@ -122,7 +122,10 @@ module CmAdmin
|
|
122
122
|
concat set_form_label(field, form_obj, is_required)
|
123
123
|
concat input_field_for_column(form_obj, field, is_required:)
|
124
124
|
concat tag.small field.helper_text, class: 'form-text text-muted' if field.helper_text.present?
|
125
|
-
|
125
|
+
if resource.errors[field.field_name].present?
|
126
|
+
error_message = resource.errors[field.field_name].first
|
127
|
+
concat(tag.p("#{field.label} #{error_message}".html_safe))
|
128
|
+
end
|
126
129
|
end)
|
127
130
|
end
|
128
131
|
end
|