How to force redirection after a render on PDF::Writer?

Hi to everyone,

In my Rails experimenting, I’ve come to a point where in the application
happens what follows.

  1. Upon selecting some stuff on a page, the user click on a button.
  2. After clicking I need to:
    2.1 Produce a PDF with some “Pretty Useful Information™”
    2.2 Bring the user to another page

The PDF being produced with PDF::Writer requires a “render” call in
order to be
created.
So if I place a “redirect_to” soon after the PDF creation, Rails
complains saying that only one “render” or “redirect” is allowed.

How can I overcome this? I don’t want the user to click multiple times
on the
same button or forcing him/her to click somewhere else in order to
change the
page.

Thanks in advance for your help.
Regards,
Carmine

Would render_to_string work for you? (http://api.rubyonrails.org)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs