2020-08-03 20:13:53 +00:00
|
|
|
# Adaptar la renderización de campos con error de Rails para que sea
|
|
|
|
# compatible con Bootstrap4. La forma actual rompe los inputs
|
|
|
|
# personalizados.
|
|
|
|
ActionView::Base.field_error_proc = proc do |html_tag, _|
|
2020-08-07 14:15:06 +00:00
|
|
|
return unless html_tag
|
|
|
|
|
2020-08-03 20:13:53 +00:00
|
|
|
html = Nokogiri::HTML::DocumentFragment.parse html_tag
|
|
|
|
html.children.first.attributes['class'].value += ' is-invalid'
|
|
|
|
|
|
|
|
html.to_s.html_safe
|
|
|
|
end
|