# How to print data with out rendring page?

**URL:** <https://www.ruby-forum.com/t/how-to-print-data-with-out-rendring-page/172960>\
**Category:** Rails\
**Created:** [July 30, 2009, 3:51pm UTC](https://www.ruby-forum.com/t/how-to-print-data-with-out-rendring-page/172960 "2009-07-30T15:51:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [July 30, 2009, 3:51pm UTC](https://www.ruby-forum.com/t/how-to-print-data-with-out-rendring-page/172960/1 "2009-07-30T15:51:08Z")

</div>

Hi all,

I have following code in haml form that print current webpage

I call this page from another page like user profile page like

=link\_to ‘Print’, print\_user\_path(@user)

this calls “print.html.haml”

## print.html.haml

## %script print(); =ALL DATA TO PRINT

PROBLEM IS THAT : I want to print data with out rendering to  
print.html.haml page.

means when i click on “print” link on profile page it directly open  
print dialog box and print data from “print.html.haml” file

How can i do that?

Thanks,  
Vikas
