How I can setup controller/response objects from scratch to ran render_to_string?
I developed an application which generate a PDF file.
I used erb
based template to generate TeX
file, then process it to convert to PDF.
It's working fine, but I now start thinking it is better to generate the report in background. Thus, I created a queuing system using delayed_job
and it's working well.
Now, when combine two of them, I realized that renderer implemented as part of controller.
What I want to do is run render_to_string to generate the PDF. It looks like I need to setup controller and response object from scratch.
I found a question (How do I call controller/view methods from the console in Rails?) relate to this, but setting up a response object by calling post
seems awkward.
How I can setup controller and response object to achieve this?