mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 14:42:33 -05:00
update form error styles
This commit is contained in:
1 parent
cdb1fd4c9f
commit
4905b13f25
4 files changed
+23
-12
No files matched your search
@@ -8,8 +8,12 @@ ActionView::Base.field_error_proc = proc do |html_tag, instance|
|
||||
field_name =
|
||||
instance.object.class.human_attribute_name(instance.instance_variable_get(:@method_name).to_s)
|
||||
|
||||
parsed_html_tag = Nokogiri::HTML::DocumentFragment.parse(html_tag)
|
||||
parsed_html_tag.children.add_class 'input-error'
|
||||
html_tag = parsed_html_tag.to_s.html_safe
|
||||
|
||||
result = html_tag
|
||||
result += ApplicationController.helpers.tag.div("#{field_name} #{errors}") if errors.present?
|
||||
result += ApplicationController.helpers.tag.label(ApplicationController.render(partial: 'shared/field_error', locals: { message: "#{field_name} #{errors}" }), class: 'label') if errors.present?
|
||||
|
||||
result
|
||||
end
|
||||
Reference in new issue
Block a user