I use prawn-rails.
I have a show.pdf.prawn
view.
I would like to have an action to download this pdf.
I tried the following:
def download
send_data(
show,
filename: "#{custom_name}.pdf",
type: 'application/pdf'
)
end
What it does, is download something called #{custom_name}.pdf
but I m unable to open it (falied to load PDF document
).
Having it changed to
def download
send_file(
show,
filename: "#{custom_name}.pdf",
type: 'application/pdf'
)
end
I am getting
no implicit conversion of true into String
Please advice.