title: Rails link to PDF version of show.html.erb
body: <p>I have created a pdf version of our rails application using the Prawn plugin, the page in question is part of the Kase model - the link to the kase is /kases/1 and the link to the pdf version is /kases/1.pdf.</p>
  
  <p>How can I add a link within the show.html.erb to the PDF file so whichever page is being viewed it updates the URL to the correct case id?</p>
  
  <pre><code>&lt;% content_for :header do -%&gt;
      &lt;%=h @kase.jobno %&gt; | &lt;%=h @kase.casesubject %&gt;
  &lt;% end -%&gt;
  
  &lt;!-- #START SIDEBAR --&gt;
  &lt;% content_for :sidebar do -%&gt;
  &lt;% if @kase.avatar.exists? then %&gt;
  &lt;%= image_tag @kase.avatar.url %&gt;
  &lt;% else %&gt;
  &lt;p style="font-size:smaller"&gt; You can upload an icon for this case that will display here. Usually this would be for the year number icon for easy recognition.&lt;/p&gt;
  &lt;% end %&gt;
  &lt;% end %&gt;
  &lt;!-- #END SIDEBAR --&gt;
  
  &lt;ul id="kases_showlist"&gt;
  
  &lt;li&gt;Date Instructed: &lt;span&gt;&lt;%=h @kase.dateinstructed %&gt;&lt;/span&gt;&lt;/li&gt; 
  &lt;li&gt;Client Company: &lt;span&gt;&lt;%=h @kase.clientcompanyname %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Client Reference: &lt;span&gt;&lt;%=h @kase.clientref %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Case Subject: &lt;span&gt;&lt;%=h @kase.casesubject %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Transport&lt;span&gt;&lt;%=h @kase.transport %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Goods&lt;span&gt;&lt;%=h @kase.goods %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Case Status: &lt;span&gt;&lt;%=h @kase.kase_status %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Client Company Address: &lt;span class="address"&gt;&lt;%=h @kase.clientcompanyaddress %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Client Company Fax: &lt;span&gt;&lt;%=h @kase.clientcompanyfax %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Case Handler: &lt;span&gt;&lt;%=h @kase.casehandlername %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Case Handler Tel: &lt;span&gt;&lt;%=h @kase.casehandlertel %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Case Handler Email: &lt;span&gt;&lt;%=h @kase.casehandleremail %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Claimant Name: &lt;span&gt;&lt;%=h @kase.claimantname %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Claimant Address: &lt;span class="address"&gt;&lt;%=h @kase.claimantaddress %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Claimant Contact: &lt;span&gt;&lt;%=h @kase.claimantcontact %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Claimant Tel: &lt;span&gt;&lt;%=h @kase.claimanttel %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Claiment Mob: &lt;span&gt;&lt;%=h @kase.claimantmob %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Claiment Email: &lt;span&gt;&lt;%=h @kase.claimantemail %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Claimant URL: &lt;span&gt;&lt;%=h @kase.claimanturl %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;Comments: &lt;span&gt;&lt;%=h @kase.comments %&gt;&lt;/span&gt;&lt;/li&gt;
  
  &lt;/ul&gt;
  
  &lt;!--- START FINANCE INFORMATION --&gt;
  &lt;div id="kase_finances"&gt;
      &lt;div class="js_option"&gt;
      &lt;h2&gt;Financial Options&lt;/h2&gt;&lt;p class="finance_showhide"&gt;&lt;%= link_to_function "Show","Element.show('finance_showhide');" %&gt; / &lt;%= link_to_function "Hide","Element.hide('finance_showhide');" %&gt;&lt;/p&gt;
      &lt;/div&gt;
  
  &lt;div id="finance_showhide" style="display:none"&gt;
  
  &lt;ul id="kases_new_finance"&gt;
  
    &lt;li&gt;Invoice Number&lt;span&gt;&lt;%=h @kase.invoicenumber %&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;Net Amount&lt;span&gt;&lt;%=h @kase.netamount %&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;VAT&lt;span&gt;&lt;%=h @kase.vat %&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;Gross Amount&lt;span&gt;&lt;%=h @kase.grossamount %&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;Date Closed&lt;span&gt;&lt;%=h @kase.dateclosed %&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;Date Paid&lt;span&gt;&lt;%=h @kase.datepaid %&gt;&lt;/span&gt;&lt;/li&gt;
  
  &lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;!--- END FINANCE INFORMATION --&gt;
  
  
  &lt;%= link_to 'Edit Case', edit_kase_path(@kase) %&gt; |
  &lt;%= link_to 'Back', kases_path %&gt; |
  &lt;a href="#"&gt;Top&lt;/a&gt;
  
      &lt;div style="width:120%; height: 50px; background-color: black; margin: 10px 0 0 -19px; padding: 0; background-color: #d4d4d4;"&gt;&amp;nbsp;&lt;/div&gt;
  
      &lt;div class="js_option_kaseemails"&gt;
          &lt;%= link_to_function "Show", 
          "Element.show('newinstructionemail1');"
          %&gt; /
          &lt;%= link_to_function "Hide", 
          "Element.hide('newinstructionemail1');"
          %&gt;
      &lt;/div&gt;
  
      &lt;h3&gt;New Instruction Email&lt;/h3&gt;
      &lt;div id="newinstructionemail1" style="display:none"&gt;
      &lt;p class="kase_email_output"&gt;
      Hi,&lt;br /&gt;
      &lt;br /&gt;
      Many thanks for your instructions in the subject matter.&lt;br /&gt;
      &lt;br /&gt;
      We have allocated reference number &lt;%=h @kase.jobno %&gt; to the above claim.&lt;br /&gt;
      &lt;br /&gt;
      We have started our inquiries and will be in touch.&lt;br /&gt;
      &lt;br /&gt;
      Best Regards,&lt;br /&gt;
      &lt;br /&gt;
      &lt;strong&gt;&lt;%=h current_user.name %&gt;&lt;/strong&gt;
      &lt;br /&gt;
      McClelland &amp;amp; Co&lt;br /&gt;
      PO Box 149&lt;br /&gt;
      Southport&lt;br /&gt;
      PR8 4GZ&lt;br /&gt;
      &lt;br /&gt;
      Tel:  +(0) 1704 569871&lt;br /&gt;
      Fax: +(0) 1704 562234&lt;br /&gt;
      Mob: &lt;%=h current_user.mobile %&gt;&lt;br /&gt;
      E-mail:  &lt;%= current_user.email %&gt;&lt;br /&gt;
      &lt;br /&gt;
      This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you receive this e-mail in error please notify the originator of the message.
      &lt;br /&gt;&lt;br /&gt;
      McClelland &amp;amp; Co has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses but it is strongly recommended that you carry out your own virus check before opening any attachment. McClelland &amp;amp; Co cannot accept liability for any damage sustained as a result of software virus infection.
      &lt;/p&gt;
  
      &lt;%= link_to 'Edit Case', edit_kase_path(@kase) %&gt; |
      &lt;%= link_to 'Back', kases_path %&gt; |
      &lt;a href="#"&gt;Top&lt;/a&gt;
  
      &lt;/div&gt;
  
          &lt;div style="width:120%; height: 20px; background-color: black; margin: 10px 0 0 -19px; padding: 0; background-color: #d4d4d4;"&gt;&amp;nbsp;&lt;/div&gt;
  
      &lt;div class="js_option_kaseemails"&gt;
          &lt;%= link_to_function "Show", 
          "Element.show('newinstructionemail');"
          %&gt; /
          &lt;%= link_to_function "Hide", 
          "Element.hide('newinstructionemail');"
          %&gt;
      &lt;/div&gt;
  
      &lt;h3&gt;New Instruction Email&lt;/h3&gt;
      &lt;div id="newinstructionemail" style="display:none"&gt;
      &lt;p class="kase_email_output"&gt;
      Hi,&lt;br /&gt;
      &lt;br /&gt;
      Many thanks for your instructions in the subject matter.&lt;br /&gt;
      &lt;br /&gt;
      We have allocated reference number &lt;%=h @kase.jobno %&gt; to the above claim.&lt;br /&gt;
      &lt;br /&gt;
      We have started our inquiries and will be in touch.&lt;br /&gt;
      &lt;br /&gt;
      Best Regards,&lt;br /&gt;
      &lt;br /&gt;
      &lt;strong&gt;&lt;%=h current_user.name %&gt;&lt;/strong&gt;
      &lt;br /&gt;
      McClelland &amp;amp; Co&lt;br /&gt;
      PO Box 149&lt;br /&gt;
      Southport&lt;br /&gt;
      PR8 4GZ&lt;br /&gt;
      &lt;br /&gt;
      Tel:  +(0) 1704 569871&lt;br /&gt;
      Fax: +(0) 1704 562234&lt;br /&gt;
      Mob: &lt;%=h current_user.mobile %&gt;&lt;br /&gt;
      E-mail:  &lt;%= current_user.email %&gt;&lt;br /&gt;
      &lt;br /&gt;
      This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you receive this e-mail in error please notify the originator of the message.
      &lt;br /&gt;&lt;br /&gt;
      McClelland &amp;amp; Co has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses but it is strongly recommended that you carry out your own virus check before opening any attachment. McClelland &amp;amp; Co cannot accept liability for any damage sustained as a result of software virus infection.
      &lt;/p&gt;
  
      &lt;%= link_to 'Edit Case', edit_kase_path(@kase) %&gt; |
      &lt;%= link_to 'Back', kases_path %&gt; |
      &lt;a href="#"&gt;Top&lt;/a&gt;
  
      &lt;/div&gt;
  
          &lt;div style="width:120%; height: 20px; background-color: black; margin: 10px 0 0 -19px; padding: 0; background-color: #d4d4d4;"&gt;&amp;nbsp;&lt;/div&gt;
  
      &lt;div class="js_option_kaseemails"&gt;
      &lt;%= link_to_function "Show", 
      "Element.show('newinstructionemail2');"
      %&gt; /
      &lt;%= link_to_function "Hide", 
      "Element.hide('newinstructionemail2');"
      %&gt;
      &lt;/div&gt;
  
      &lt;h3&gt;New Instruction Email&lt;/h3&gt;
      &lt;div id="newinstructionemail2" style="display:none;"&gt;
      &lt;p class="kase_email_output"&gt;
      Hi,&lt;br /&gt;
      &lt;br /&gt;
      Many thanks for your instructions in the subject matter.&lt;br /&gt;
      &lt;br /&gt;
      We have allocated reference number &lt;%=h @kase.jobno %&gt; to the above claim.&lt;br /&gt;
      &lt;br /&gt;
      We have started our inquiries and will be in touch.&lt;br /&gt;
      &lt;br /&gt;
      Best Regards,&lt;br /&gt;
      &lt;br /&gt;
      &lt;strong&gt;&lt;%=h current_user.name %&gt;&lt;/strong&gt;
      &lt;br /&gt;
      McClelland &amp;amp; Co&lt;br /&gt;
      PO Box 149&lt;br /&gt;
      Southport&lt;br /&gt;
      PR8 4GZ&lt;br /&gt;
      &lt;br /&gt;
      Tel:  +(0) 1704 569871&lt;br /&gt;
      Fax: +(0) 1704 562234&lt;br /&gt;
      Mob: &lt;%=h current_user.mobile %&gt;&lt;br /&gt;
      E-mail:  &lt;%= current_user.email %&gt;&lt;br /&gt;
      &lt;br /&gt;
      This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you receive this e-mail in error please notify the originator of the message.
      &lt;br /&gt;&lt;br /&gt;
      McClelland &amp;amp; Co has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses but it is strongly recommended that you carry out your own virus check before opening any attachment. McClelland &amp;amp; Co cannot accept liability for any damage sustained as a result of software virus infection.
      &lt;/p&gt;
  
      &lt;%= link_to 'Edit Case', edit_kase_path(@kase) %&gt; |
      &lt;%= link_to 'Back', kases_path %&gt; |
      &lt;a href="#"&gt;Top&lt;/a&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>Danny</p>