Hide delete attachment button when none present

This commit is contained in:
wvengen 2016-05-06 15:56:26 +02:00
parent 3e5b320a6b
commit 961c50b7e5

View file

@ -23,7 +23,8 @@
= f.input :deposit, as: :string = f.input :deposit, as: :string
= f.input :deposit_credit, as: :string = f.input :deposit_credit, as: :string
= f.input :attachment, as: :file, hint: t('.attachment_hint') = 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 = f.input :note
.form-actions .form-actions
= f.submit class: 'btn' = f.submit class: 'btn'