Redirect to pdf attachement old name if not attached
This commit is contained in:
parent
0201a501c6
commit
347f03d2a9
6 changed files with 23 additions and 32 deletions
|
@ -14,10 +14,10 @@ module Instructeurs
|
|||
after_action :mark_annotations_privees_as_read, only: [:annotations_privees, :update_annotations]
|
||||
|
||||
def attestation
|
||||
if dossier.attestation.pdf_active_storage.attached?
|
||||
if dossier.attestation.pdf.attached?
|
||||
redirect_to url_for(dossier.attestation.pdf)
|
||||
elsif dossier.attestation.pdf_active_storage.attached?
|
||||
redirect_to url_for(dossier.attestation.pdf_active_storage)
|
||||
else
|
||||
send_data(dossier.attestation.pdf.read, filename: 'attestation.pdf', type: 'application/pdf')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue