controllers: use template: rather than file: to render PDFs

ActionView now throws an error if a relative path is used with `file:`.
This commit is contained in:
Pierre de La Morinerie 2021-02-17 18:02:31 +00:00
parent 185c74d891
commit 3f3d6ae399
5 changed files with 6 additions and 6 deletions

View file

@ -42,7 +42,7 @@ module Instructeurs
respond_to do |format|
format.pdf do
@include_infos_administration = true
render(file: 'dossiers/show', formats: [:pdf])
render(template: 'dossiers/show', formats: [:pdf])
end
format.all
end
@ -235,7 +235,7 @@ module Instructeurs
def generate_pdf_for_instructeur_export
@include_infos_administration = true
pdf = render_to_string(file: 'dossiers/show', formats: [:pdf])
pdf = render_to_string(template: 'dossiers/show', formats: [:pdf])
dossier.pdf_export_for_instructeur.attach(io: StringIO.open(pdf), filename: "export-#{dossier.id}.pdf", content_type: 'application/pdf')
end