module Prawn::Rails::PrawnHelper
Public Instance Methods
disposition(download, filename)
click to toggle source
# File lib/prawn_rails.rb, line 24 def disposition(download, filename) download = true if (filename && download == nil) disposition = download ? "attachment;" : "inline;" disposition += " filename=\"#{filename}\"" if filename headers["Content-Disposition"] = disposition end
prawn_document(opts={}) { |pdf| ... }
click to toggle source
# File lib/prawn_rails.rb, line 13 def prawn_document(opts={}) download = opts.delete(:force_download) filename = opts.delete(:filename) pdf = (opts.delete(:renderer) || Prawn::Document).new(opts) yield pdf if block_given? disposition(download, filename) if (download || filename) pdf.render end