Forum: Ruby on Rails How to make my own render method

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Damjan R. (Guest)
on 2009-05-04 23:49
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.pdf   { render :file :=> 'my_file' }

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.

Nicolai R. (Guest)
on 2009-05-05 01:02
(Received via mailing list)
You might want to look into "prawn" and "prawnto".

This topic is locked and can not be replied to.