models: fix attestation template rendering on Rails 6

This commit is contained in:
Pierre de La Morinerie 2020-06-30 10:32:55 +02:00
parent 04a6862fa6
commit a4ed845e43

View file

@ -110,7 +110,7 @@ class AttestationTemplate < ApplicationRecord
def build_pdf(dossier)
attestation = render_attributes_for(dossier: dossier)
action_view = ActionView::Base.new(ActionController::Base.view_paths, attestation: attestation)
attestation_view = action_view.render(file: 'admin/attestation_templates/show', formats: [:pdf])
attestation_view = action_view.render(file: 'admin/attestation_templates/show.pdf.prawn')
StringIO.new(attestation_view)
end