I have the following link_to path:
http: // localhost: 3000 / letters / showpdf / 3
I have the following user action in my email controller:
def showpdf
@letter = Letter.find(params[:id])
@redcloth_letter = " <style type='text/css'> </style>"
@redcloth_letter = @redcloth_letter << RedCloth.new(@letter.body).to_html
pdf = PDFKit.new(@redcloth_letter)
pdf.stylesheets << "#{RAILS_ROOT}/public/stylesheets/compiled/pdf.css"
send_data(pdf.to_pdf, :filename => "pdf.pdf")
end
I am currently not returning anything to the browser.
EDIT: This is what I see in ruby magazines:
Processing LettersController
Parameters: {"action"=>"showpdf", "id"=>"3", "controller"=>"letters"}
Letter Load (1.5ms) SELECT * FROM "letters" WHERE ("letters"."id" = 3)
Sending data pdf.pdf
Completed in 1917ms (View: 6, DB: 2) | 200 OK [http:
source
share