Class: Spina::Shop::Admin::InvoicesController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/spina/shop/admin/invoices_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



4
5
6
7
8
9
# File 'app/controllers/spina/shop/admin/invoices_controller.rb', line 4

def show
  @invoice = Invoice.find(params[:id])
  presenter = InvoicePresenter.new(@invoice, view_context)
  pdf = InvoicePdf.new(presenter)
  send_data pdf.render, filename: @invoice.filename, type: "application/pdf"
end