title: How I can setup controller/response object from scratch to run render_to_string?
body: <p>How I can setup controller/response objects from scratch to ran render_to_string?</p>
  
  <p>I developed an application which generate a PDF file.
  I used <code>erb</code> based template to generate <code>TeX</code> file, then process it to convert to PDF.</p>
  
  <p>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 <code>delayed_job</code> and it's working well.</p>
  
  <p>Now, when combine two of them, I realized that renderer implemented as part of controller.</p>
  
  <p>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.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/151030/how-do-i-call-controller-view-methods-from-the-console-in-rails/">a question (How do I call controller/view methods from the console in Rails?)</a> relate to this, but setting up a response object by calling <code>post</code> seems awkward.</p>
  
  <p>How I can setup controller and response object to achieve this?</p>