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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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.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
Nicolai R. (Guest)
on 2009-05-05 01:02
(Received via mailing list)
You might want to look into "prawn" and "prawnto".
http://prawn.majesticseacreature.com/
http://www.cracklabs.com/prawnto

Regards
Nicolai
This topic is locked and can not be replied to.