Remove uneeded lines
Rails form already add an error class when image or document attachments has validations errors.
This commit is contained in:
@@ -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"),
|
||||||
|
|||||||
@@ -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"),
|
||||||
|
|||||||
Reference in New Issue
Block a user