# How to make my own render method

**URL:** <https://www.ruby-forum.com/t/how-to-make-my-own-render-method/167157>\
**Category:** Rails\
**Created:** [May 4, 2009, 9:49pm UTC](https://www.ruby-forum.com/t/how-to-make-my-own-render-method/167157 "2009-05-04T21:49:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [May 4, 2009, 9:49pm UTC](https://www.ruby-forum.com/t/how-to-make-my-own-render-method/167157/1 "2009-05-04T21:49:44Z")

</div>

I would like to create method to render for my own format. What I would  
like to accomplish is something like this:

respond\_to do |format|  
format.html  
format.pdf { render :file :=\> ‘my\_file’ }  
end

Where format.pdf is what I would like to accomplish. I guess I must do  
two things:

1. Register new format (format.pdf)
2. Implement rendering method.

Can someone please direct me where should I begin. I don’t seem to find  
any good (easy) directions on the net.

by  
TheR

---

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [May 4, 2009, 11:02pm UTC](https://www.ruby-forum.com/t/how-to-make-my-own-render-method/167157/2 "2009-05-04T23:02:16Z")

</div>

You might want to look into “prawn” and “prawnto”.  
[http://prawn.majesticseacreature.com/](http://prawn.majesticseacreature.com/)  
[http://www.cracklabs.com/prawnto](http://www.cracklabs.com/prawnto)

Regards  
Nicolai
