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

@ -121,7 +121,7 @@ class AttestationTemplate < ApplicationRecord
def build_pdf(dossier)
attestation = render_attributes_for(dossier: dossier)
attestation_view = ApplicationController.render(
file: 'new_administrateur/attestation_templates/show',
template: 'new_administrateur/attestation_templates/show',
formats: :pdf,
assigns: { attestation: attestation }
)