PDF

Ruby code posted by Rails
created at 07 Oct 18:57

Edit | Back
1
2
3
4
5
6
Mime::Type.register "application/pdf", :pdf

ActionController.add_renderer :pdf do |template, options|
  string = render_to_string template, options
  send_data PdfUtils.string_to_pdf(string), :type => Mime::PDF
end
220 Bytes in 2 ms with coderay