Permalink
Browse files

cache = false en development

  • Loading branch information...
1 parent 918ba0e commit 76024b1f10c090936c88df225d70914012aa0481 @eeng committed Sep 6, 2013
@@ -68,11 +68,12 @@ def render_pdf(options = {})
output_file = (options.has_key?(:pdf_file)) ? options[:pdf_file] : File.join(File.expand_path("#{tmp_dir}"),"#{html_digest}.pdf")
password = (options.has_key?(:password)) ? options[:password] : ""
+ cache = params[:cache] || (Rails.env.development? ? 'false' : 'true')
generate_options = ActsAsFlyingSaucer::Config.options.merge({
:input_file => input_file,
:output_file => output_file,
:html => html,
- :cache => params[:cache] || "true"
+ :cache => cache
})
ActsAsFlyingSaucer::Xhtml2Pdf.write_pdf(generate_options)
@@ -32,8 +32,8 @@ def self.setup_nailgun
acts_as_flying_saucer_jar_path = File.expand_path(File.join(File.dirname(__FILE__),'java','jar','acts_as_flying_saucer.jar'))
# ADD IN NAILGUN CLASS
Nailgun::NgCommand.ng_cp(acts_as_flying_saucer_jar_path)
- Nailgun::NgCommand.ng_alias("Xhtml2Pdf","acts_as_flying_saucer.Xhtml2Pdf")
- Nailgun::NgCommand.ng_alias("encryptPdf", "acts_as_flying_saucer.encryptPdf")
+ # Nailgun::NgCommand.ng_alias("Xhtml2Pdf","acts_as_flying_saucer.Xhtml2Pdf")
+ # Nailgun::NgCommand.ng_alias("encryptPdf", "acts_as_flying_saucer.encryptPdf")
end
end
@@ -4,7 +4,7 @@ module ActsAsFlyingSaucer
# Xhtml2Pdf
#
class Xhtml2Pdf
- def self.write_pdf(options)
+ def self.write_pdf(options)
return if options[:cache] == "true" && File.exists?(options[:output_file])
if !File.exists?(options[:input_file])

0 comments on commit 76024b1

Please sign in to comment.