Remove uneeded lines

Rails form already add an error class when image or document attachments
has validations errors.
This commit is contained in:
Senén Rodero Rodríguez
2019-09-23 10:51:17 +02:00
parent 608e113d03
commit d1af36d1be
2 changed files with 0 additions and 2 deletions

View File

@@ -32,7 +32,6 @@ module DocumentsHelper
end end
def render_attachment(builder, document) def render_attachment(builder, document)
klass = document.errors[:attachment].any? ? "error" : ""
klass = document.persisted? || document.cached_attachment.present? ? " hide" : "" klass = document.persisted? || document.cached_attachment.present? ? " hide" : ""
html = builder.label :attachment, html = builder.label :attachment,
t("documents.form.attachment_label"), t("documents.form.attachment_label"),

View File

@@ -46,7 +46,6 @@ module ImagesHelper
end end
def render_image_attachment(builder, imageable, image) def render_image_attachment(builder, imageable, image)
klass = image.errors[:attachment].any? ? "error" : ""
klass = image.persisted? || image.cached_attachment.present? ? " hide" : "" klass = image.persisted? || image.cached_attachment.present? ? " hide" : ""
html = builder.label :attachment, html = builder.label :attachment,
t("images.form.attachment_label"), t("images.form.attachment_label"),