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:
parent
185c74d891
commit
3f3d6ae399
5 changed files with 6 additions and 6 deletions
|
@ -3,7 +3,7 @@ class API::V2::DossiersController < API::V2::BaseController
|
|||
|
||||
def pdf
|
||||
@include_infos_administration = true
|
||||
render(file: 'dossiers/show', formats: [:pdf])
|
||||
render(template: 'dossiers/show', formats: [:pdf])
|
||||
end
|
||||
|
||||
def geojson
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ module Users
|
|||
|
||||
def generate_empty_pdf(procedure)
|
||||
@dossier = procedure.new_dossier
|
||||
s = render_to_string(file: 'dossiers/dossier_vide', formats: [:pdf])
|
||||
s = render_to_string(template: 'dossiers/dossier_vide', formats: [:pdf])
|
||||
send_data(s, :filename => "#{procedure.libelle}.pdf")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ module Users
|
|||
respond_to do |format|
|
||||
format.pdf do
|
||||
@include_infos_administration = false
|
||||
render(file: 'dossiers/show', formats: [:pdf])
|
||||
render(template: 'dossiers/show', formats: [:pdf])
|
||||
end
|
||||
format.all
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue