Generating PDF's via Delayed Job while maintaing a RESTful pattern.

Posted by Jeff on Stack Overflow See other posts from Stack Overflow or by Jeff
Published on 2010-04-22T18:59:31Z Indexed on 2010/04/22 19:03 UTC
Read the original article Hit count: 271

Filed under:
|
|
|

Hi, currently I am running a Rails app on Heroku, and everything is working great with exception of generating PDF documents that sometimes contain thousands of records. Heroku has a built-in timeout of 30 seconds, so if the request takes more than 30 seconds, it's abandoned.

That's fine, since they offer delayed_job support built-in. However, all of the PDF's i generate follow a typical restful pattern. For instance, a request to "/posts.pdf" generates a pdf (using PRAWN and PRAWNTO) and it's delivered to the browser.

So my basic question is, how do I create dynamically generated PDF's with delayed_job while maintaining the basic RESTful patterns Rail's so conveniently provides. Thanks.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about delayed-job