From 961c50b7e5072872e105f2db59c481a1a0c08651 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 May 2016 15:56:26 +0200 Subject: [PATCH] Hide delete attachment button when none present --- app/views/finance/invoices/_form.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/finance/invoices/_form.html.haml b/app/views/finance/invoices/_form.html.haml index c130a954..ca30a4d2 100644 --- a/app/views/finance/invoices/_form.html.haml +++ b/app/views/finance/invoices/_form.html.haml @@ -23,7 +23,8 @@ = f.input :deposit, as: :string = f.input :deposit_credit, as: :string = f.input :attachment, as: :file, hint: t('.attachment_hint') - = f.input :delete_attachment, as: :boolean + - if f.object.attachment_data.present? + = f.input :delete_attachment, as: :boolean = f.input :note .form-actions = f.submit class: 'btn'