ruby - Setting the filename for a pdf using prawn-rails in rails 4.0 doesn't work in IE11 -
i'm using prawn-rails gem generate pdf , setting filename overwriting @filename
variable in controller eg:
respond_to |format| format.pdf @filename = "newreportname.pdf" render 'report' end end
i using following view generate pdf:
data_rows = [@report.fields.map{|f| f.titleize }] @report.results.each |result| data_rows << @report.fields.map{|k| result.send(k) } end prawn_document() |pdf| pdf.table(data_rows) end
the pdf generation works in browsers i've tested when go save pdf in ie11, sets filename action name instead of name specified in @filename
variable.
i've posted comment on git repo prawn-rails gem i'm wondering if here help. in advance.
you can set file name using prawnto
format.pdf @filename = "newreportname.pdf" prawnto :filename=>@filename end
Comments
Post a Comment