Bug fix
This commit is contained in:
parent
d3c14a3165
commit
5d1e383e6a
@ -145,7 +145,7 @@ class Admin::OffersController < ApplicationController
|
||||
|
||||
if document.document.file
|
||||
if document.particulars?
|
||||
zipfile.add("#{customer_name}/#{document_name}/#{document.title}-NÉGOS.pdf", document.get_particularized_document_file.path)
|
||||
zipfile.add("#{customer_name}/#{document_name}/#{document.title}-NÉGOS.pdf", document.get_particularized_document_file_path)
|
||||
else
|
||||
zipfile.add("#{customer_name}/#{document_name}/#{document.title}-NÉGOS.pdf", document.document.current_path)
|
||||
end
|
||||
|
@ -34,13 +34,7 @@ class Public::DocumentsController < ApplicationController
|
||||
end
|
||||
if @document.particulars
|
||||
|
||||
|
||||
|
||||
send_data @document.get_particularized_document_file , :filename =>"negos-document-#{@document.id}.pdf" , :type => 'application/pdf',:disposition => (params[:inline] ? 'inline' : "attachment")
|
||||
|
||||
|
||||
|
||||
|
||||
send_data @document.get_particularized_document_file_path , :filename =>"negos-document-#{@document.id}.pdf" , :type => 'application/pdf',:disposition => (params[:inline] ? 'inline' : "attachment")
|
||||
|
||||
#render :inline => "j"
|
||||
else
|
||||
|
@ -75,7 +75,7 @@ class Document < ActiveRecord::Base
|
||||
end
|
||||
|
||||
|
||||
def get_particularized_document_file
|
||||
def get_particularized_document_file_path
|
||||
@temp_file = "#{Rails.root}/pdf/documents/#{self.id}_temp.pdf"
|
||||
@final_file = "#{Rails.root}/pdf/documents/#{self.id}.pdf"
|
||||
@final_file2 = "#{Rails.root}/pdf/documents/#{self.id}-2.pdf"
|
||||
@ -110,8 +110,8 @@ class Document < ActiveRecord::Base
|
||||
|
||||
::POSIX::Spawn::Child.new 'pdftk', "A="+self.document.file.path, 'B='+@final_file ,"cat", "B1", "A2-end", 'output', @final_file2
|
||||
|
||||
@final_file2
|
||||
|
||||
@data_to_send = File.open( @final_file2).read
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user