Shrimp: PDF Generation with Progress Indicator or Counter

I use shrimp and prawnto to create PDF files in my rails application. Is there a way to show the user a counter or progress bar while creating a PDF file? I am thinking of showing spinner-div in a document using "generate-pdf-link" when running pdf-action and then deleting it when rendering is complete (all, for example, using jquery). How can i call this?

Thank you for your help!

+3
source share
1 answer

Instead of immediately creating a PDF file, you can display a results page with a counter and create a PDF document in a background job. I recommend Gems DelayedJob or Resque for creating a background of tasks, placing them in several queues and subsequent processing. There are good Railscasts for both. You can use the jQuery Timer plugin to periodically check if a PDF file has been created.

0
source

All Articles