if params[:invoice_id].presence
@invoice = Invoice.find(params[:invoice_id])
attachments['invoice.pdf'] = WickedPdf.new.pdf_from_string(
render_to_string(
template: 'invoices/service',
locals: { current_user: }
)
)
end
I have attached a PDF from wickedpdf but after sending the attachment it comes as blank white page.
I am trying to send Attachment in Ruby on Rails with ActionMailer with PDF as an attachment.