diff --git a/app/controllers/estimate_controller.rb b/app/controllers/estimate_controller.rb index 07b9816..fd37dd0 100644 --- a/app/controllers/estimate_controller.rb +++ b/app/controllers/estimate_controller.rb @@ -28,7 +28,7 @@ class EstimateController < ApplicationController estimate = get_estimate begin - send_data estimate.pdf, filename: "estimate #{e.doc_number}.pdf", :disposition => 'inline', :type => "application/pdf" + send_data estimate.pdf, filename: "estimate #{estimate.doc_number}.pdf", :disposition => 'inline', :type => "application/pdf" rescue redirect_to :back, :flash => { :error => "Estimate not found" } end @@ -41,7 +41,7 @@ class EstimateController < ApplicationController estimate = get_estimate begin - send_data estimate.pdf, filename: "estimate #{e.doc_number}.pdf", :disposition => 'inline', :type => "application/pdf" + send_data estimate.pdf, filename: "estimate #{estimate.doc_number}.pdf", :disposition => 'inline', :type => "application/pdf" rescue redirect_to :back, :flash => { :error => "Estimate not found" } end