# Render :file in another window

**URL:** <https://www.ruby-forum.com/t/render-file-in-another-window/172367>\
**Category:** Rails\
**Created:** [July 20, 2009, 12:19pm UTC](https://www.ruby-forum.com/t/render-file-in-another-window/172367 "2009-07-20T12:19:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [July 20, 2009, 12:19pm UTC](https://www.ruby-forum.com/t/render-file-in-another-window/172367/1 "2009-07-20T12:19:34Z")

</div>

is there a way to render a file in another window

I wrote :  
def show  
@asset = Asset.find(params[:id])

```
respond_to do |format|
  format.html
  format.xml { render :xml => @asset }
  format.pdf {render :file => @asset.data.path }
end

```

end

this render in the current window…

thanks for your suggestions

erwin

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [July 20, 2009, 1:37pm UTC](https://www.ruby-forum.com/t/render-file-in-another-window/172367/2 "2009-07-20T13:37:19Z")

</div>

Thanks Sijo

I also found that I could use the :popup =\> true in the ‘link\_to’

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [July 20, 2009, 12:45pm UTC](https://www.ruby-forum.com/t/render-file-in-another-window/172367/3 "2009-07-20T12:45:06Z")

</div>

format.pdf {send\_data(@asset, :filename =\> @asset.data.path, :type  
=\>‘application/pdf’,:disposition =\> ‘inline’) }

Sijo
