From e115e8fe94591cbba1e05eec41a0220d5c9fcc78 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 18 Apr 2016 12:08:08 -0400 Subject: [PATCH] Update estimate_controller.rb Added Document Number to the file name --- app/controllers/estimate_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/estimate_controller.rb b/app/controllers/estimate_controller.rb index a244b7f..4311159 100644 --- a/app/controllers/estimate_controller.rb +++ b/app/controllers/estimate_controller.rb @@ -15,8 +15,9 @@ class EstimateController < ApplicationController # def show base = QboEstimate.get_base.service - @pdf = base.pdf(base.fetch_by_id(params[:id])) - send_data @pdf, filename: "estimate.pdf", :disposition => 'inline', :type => "application/pdf" + estimate = base.fetch_by_id(params[:id]) + @pdf = base.pdf(estimate) + send_data @pdf, filename: "estimate #{estimate.doc_number}.pdf", :disposition => 'inline', :type => "application/pdf" end end