title: Rails html render to string
body: <p>How can I render an HTML view into a string(saved in the database) to be able to render it back from it in rails?</p>
  
  <pre><code>def show_offer
    respond_to do |format|
      format.html { render 'offer_template_one', :layout =&gt; 'templates'}
      format.pdf do
        render :pdf =&gt; 'oferta',
        :template =&gt; 'templates/show_offer.pdf.erb',
        :layout =&gt; "layouts/templates.html.erb",
        :save_to_file =&gt; Rails.root.join('public', "Oferta.pdf")
      end
    end
  end
  </code></pre>
  
  <p>This is the method through which I'm rendering my view</p>
  
  <p>Thanks!</p>