Improve memory utulization in PDF report generator [SCI-1482]

This commit is contained in:
Oleksii Kriuchykhin 2017-10-02 11:29:22 +02:00
parent 03743a21f6
commit 6824f9a8bc
2 changed files with 3 additions and 4 deletions

View file

@ -182,7 +182,8 @@ class ReportsController < ApplicationController
@html = '<h1>No content</h1>' if @html.blank?
render pdf: 'report',
header: { right: '[page] of [topage]' },
template: 'reports/report.pdf.erb'
template: 'reports/report.pdf.erb',
disable_javascript: true
end
end
end

View file

@ -10,9 +10,7 @@
<body class="print-report-body">
<div class="print-report">
<% # Also whitelist <img> and <input type="checkbox"> tags %>
<%= sanitize_input(fix_smart_annotation_image(@html),
['img', 'input'],
['type', 'disabled', 'checked']) %>
<%= @html.html_safe %>
</div>
</body>
</html>