Class: MnoEnterprise::InvoicesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- MnoEnterprise::InvoicesController
- Defined in:
- app/controllers/mno_enterprise/invoices_controller.rb
Instance Method Summary collapse
-
#show ⇒ Object
GET /mnoe/invoices/201504-NU4.
Instance Method Details
#show ⇒ Object
GET /mnoe/invoices/201504-NU4
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/mno_enterprise/invoices_controller.rb', line 7 def show @invoice = MnoEnterprise::Invoice.where(slug: params[:id].upcase).reload.first :manage_billing, current_user.organizations.find(@invoice.organization_id) respond_to do |format| if @invoice filename = "Invoice - #{@invoice.slug}.pdf" pdf_view = MnoEnterprise::InvoicePdf.new(@invoice).render format.html { send_data pdf_view, filename: filename, type: "application/pdf", disposition: 'inline' } else format.html { redirect_to root_path, :alert => 'Sorry, the page requested could not be displayed' } end end end |