rubyonrailsin

A Ruby and Rails talk

Friday, March 19, 2010


Re: [Rails] How to save rails generated pages to a file on the server

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

On Mar 19, 2010, at 11:43 AM, Fritz Trapper wrote:

> My show view of a data form is finished and now I want to give a
> possibility to download this view as a pdf file.
>
> I would like to use HTMLDOC to convert the html text to pdf. My idea:
> save the html text to a temporary folder and run HTMLDOC.
>
> But how can I save the html text to a file?

render_to_string

http://api.rubyonrails.org/classes/ActionController/Base.html#M000659

That puts it into a local variable anyway... if you can then pass that
to htmldoc you're on your way. Not sure how this might affect any
paths to CSS/images for HTMLDOC though.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive