下方号码2,我收到这个错误:
Errno::ENOENT in OrdersController#print
def generate_receipt(filename = nil,current_user = nil) filename ||= "public/receipts/#{id}.pdf" Prawn::Document.generate(filename,:page_layout => :portrait,:page_size => 'LETTER',:skip_page_creation => false,:top_margin => 50,:left_margin => 50)do |pdf| pdf_receipt_data(pdf,false,'store_front',current_user) pdf.number_pages "<page> of <total>",:at => [0,0] end end
解决方法
完成路径后,解决了我的问题.
filename || =“#{Rails.root} / public / receipts /#{id} .pdf”