# Unexpected download popup

**URL:** <https://www.ruby-forum.com/t/unexpected-download-popup/159722>\
**Category:** Rails\
**Created:** [February 7, 2009, 4:05pm UTC](https://www.ruby-forum.com/t/unexpected-download-popup/159722 "2009-02-07T16:05:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@luma](https://www.ruby-forum.com/u/luma)\
**Post date:** [February 7, 2009, 4:05pm UTC](https://www.ruby-forum.com/t/unexpected-download-popup/159722/1 "2009-02-07T16:05:08Z")

</div>

I’m creating some pdfs using PDF::Writer:

def my\_action  
invoice\_pdf = render\_to\_string(:action =\> ‘…/orders/  
invoice.rpdf’, :layout =\> false)  
path = …  
File.open(path, “wb”) {|f| f.write invoice\_pdf}  
end

At the end of the action, my\_action.html.erb should be rendered. But  
I’m getting an unexpected download popup:

(controller-name).pdf  
type: Adobe Acrobat Document, 11.2 kb  
from: [http://localhost:3000](http://localhost:3000)

thanks,  
Luma
