Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 752009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:43:56+00:00 2026-05-14T14:43:56+00:00

I have created a pdf version of our rails application using the Prawn plugin,

  • 0

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.

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?

<% content_for :header do -%>
    <%=h @kase.jobno %> | <%=h @kase.casesubject %>
<% end -%>

<!-- #START SIDEBAR -->
<% content_for :sidebar do -%>
<% if @kase.avatar.exists? then %>
<%= image_tag @kase.avatar.url %>
<% else %>
<p style="font-size:smaller"> You can upload an icon for this case that will display here. Usually this would be for the year number icon for easy recognition.</p>
<% end %>
<% end %>
<!-- #END SIDEBAR -->

<ul id="kases_showlist">

<li>Date Instructed: <span><%=h @kase.dateinstructed %></span></li> 
<li>Client Company: <span><%=h @kase.clientcompanyname %></span></li>
<li>Client Reference: <span><%=h @kase.clientref %></span></li>
<li>Case Subject: <span><%=h @kase.casesubject %></span></li>
<li>Transport<span><%=h @kase.transport %></span></li>
<li>Goods<span><%=h @kase.goods %></span></li>
<li>Case Status: <span><%=h @kase.kase_status %></span></li>
<li>Client Company Address: <span class="address"><%=h @kase.clientcompanyaddress %></span></li>
<li>Client Company Fax: <span><%=h @kase.clientcompanyfax %></span></li>
<li>Case Handler: <span><%=h @kase.casehandlername %></span></li>
<li>Case Handler Tel: <span><%=h @kase.casehandlertel %></span></li>
<li>Case Handler Email: <span><%=h @kase.casehandleremail %></span></li>
<li>Claimant Name: <span><%=h @kase.claimantname %></span></li>
<li>Claimant Address: <span class="address"><%=h @kase.claimantaddress %></span></li>
<li>Claimant Contact: <span><%=h @kase.claimantcontact %></span></li>
<li>Claimant Tel: <span><%=h @kase.claimanttel %></span></li>
<li>Claiment Mob: <span><%=h @kase.claimantmob %></span></li>
<li>Claiment Email: <span><%=h @kase.claimantemail %></span></li>
<li>Claimant URL: <span><%=h @kase.claimanturl %></span></li>
<li>Comments: <span><%=h @kase.comments %></span></li>

</ul>

<!--- START FINANCE INFORMATION -->
<div id="kase_finances">
    <div class="js_option">
    <h2>Financial Options</h2><p class="finance_showhide"><%= link_to_function "Show","Element.show('finance_showhide');" %> / <%= link_to_function "Hide","Element.hide('finance_showhide');" %></p>
    </div>

<div id="finance_showhide" style="display:none">

<ul id="kases_new_finance">

  <li>Invoice Number<span><%=h @kase.invoicenumber %></span></li>
  <li>Net Amount<span><%=h @kase.netamount %></span></li>
  <li>VAT<span><%=h @kase.vat %></span></li>
  <li>Gross Amount<span><%=h @kase.grossamount %></span></li>
  <li>Date Closed<span><%=h @kase.dateclosed %></span></li>
  <li>Date Paid<span><%=h @kase.datepaid %></span></li>

</ul></div>
</div>
<!--- END FINANCE INFORMATION -->


<%= link_to 'Edit Case', edit_kase_path(@kase) %> |
<%= link_to 'Back', kases_path %> |
<a href="#">Top</a>

    <div style="width:120%; height: 50px; background-color: black; margin: 10px 0 0 -19px; padding: 0; background-color: #d4d4d4;">&nbsp;</div>

    <div class="js_option_kaseemails">
        <%= link_to_function "Show", 
        "Element.show('newinstructionemail1');"
        %> /
        <%= link_to_function "Hide", 
        "Element.hide('newinstructionemail1');"
        %>
    </div>

    <h3>New Instruction Email</h3>
    <div id="newinstructionemail1" style="display:none">
    <p class="kase_email_output">
    Hi,<br />
    <br />
    Many thanks for your instructions in the subject matter.<br />
    <br />
    We have allocated reference number <%=h @kase.jobno %> to the above claim.<br />
    <br />
    We have started our inquiries and will be in touch.<br />
    <br />
    Best Regards,<br />
    <br />
    <strong><%=h current_user.name %></strong>
    <br />
    McClelland &amp; Co<br />
    PO Box 149<br />
    Southport<br />
    PR8 4GZ<br />
    <br />
    Tel:  +(0) 1704 569871<br />
    Fax: +(0) 1704 562234<br />
    Mob: <%=h current_user.mobile %><br />
    E-mail:  <%= current_user.email %><br />
    <br />
    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.
    <br /><br />
    McClelland &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; Co cannot accept liability for any damage sustained as a result of software virus infection.
    </p>

    <%= link_to 'Edit Case', edit_kase_path(@kase) %> |
    <%= link_to 'Back', kases_path %> |
    <a href="#">Top</a>

    </div>

        <div style="width:120%; height: 20px; background-color: black; margin: 10px 0 0 -19px; padding: 0; background-color: #d4d4d4;">&nbsp;</div>

    <div class="js_option_kaseemails">
        <%= link_to_function "Show", 
        "Element.show('newinstructionemail');"
        %> /
        <%= link_to_function "Hide", 
        "Element.hide('newinstructionemail');"
        %>
    </div>

    <h3>New Instruction Email</h3>
    <div id="newinstructionemail" style="display:none">
    <p class="kase_email_output">
    Hi,<br />
    <br />
    Many thanks for your instructions in the subject matter.<br />
    <br />
    We have allocated reference number <%=h @kase.jobno %> to the above claim.<br />
    <br />
    We have started our inquiries and will be in touch.<br />
    <br />
    Best Regards,<br />
    <br />
    <strong><%=h current_user.name %></strong>
    <br />
    McClelland &amp; Co<br />
    PO Box 149<br />
    Southport<br />
    PR8 4GZ<br />
    <br />
    Tel:  +(0) 1704 569871<br />
    Fax: +(0) 1704 562234<br />
    Mob: <%=h current_user.mobile %><br />
    E-mail:  <%= current_user.email %><br />
    <br />
    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.
    <br /><br />
    McClelland &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; Co cannot accept liability for any damage sustained as a result of software virus infection.
    </p>

    <%= link_to 'Edit Case', edit_kase_path(@kase) %> |
    <%= link_to 'Back', kases_path %> |
    <a href="#">Top</a>

    </div>

        <div style="width:120%; height: 20px; background-color: black; margin: 10px 0 0 -19px; padding: 0; background-color: #d4d4d4;">&nbsp;</div>

    <div class="js_option_kaseemails">
    <%= link_to_function "Show", 
    "Element.show('newinstructionemail2');"
    %> /
    <%= link_to_function "Hide", 
    "Element.hide('newinstructionemail2');"
    %>
    </div>

    <h3>New Instruction Email</h3>
    <div id="newinstructionemail2" style="display:none;">
    <p class="kase_email_output">
    Hi,<br />
    <br />
    Many thanks for your instructions in the subject matter.<br />
    <br />
    We have allocated reference number <%=h @kase.jobno %> to the above claim.<br />
    <br />
    We have started our inquiries and will be in touch.<br />
    <br />
    Best Regards,<br />
    <br />
    <strong><%=h current_user.name %></strong>
    <br />
    McClelland &amp; Co<br />
    PO Box 149<br />
    Southport<br />
    PR8 4GZ<br />
    <br />
    Tel:  +(0) 1704 569871<br />
    Fax: +(0) 1704 562234<br />
    Mob: <%=h current_user.mobile %><br />
    E-mail:  <%= current_user.email %><br />
    <br />
    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.
    <br /><br />
    McClelland &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; Co cannot accept liability for any damage sustained as a result of software virus infection.
    </p>

    <%= link_to 'Edit Case', edit_kase_path(@kase) %> |
    <%= link_to 'Back', kases_path %> |
    <a href="#">Top</a>
    </div>

Thanks,

Danny

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:43:56+00:00Added an answer on May 14, 2026 at 2:43 pm

    For anyone who is interested…

    <p><%= link_to "Printable Case (PDF)", kase_path(@kase, :format => 'pdf') %></p>
    

    Does the job nicely. It also works even if you are using Wicked PDF gem, since it handles PDF-format requests

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a C# class file by using a XSD-file as an input.
Scenario: I have a document I created using LaTeX (my resume in this case),
New to Objective C. I have created a few directories which contain pdf files
Hi I have created a PDF file with an image in it, I want
I have a row of buttons, which all create a pdf file which I
I have a directory with PDF files that I need to create an index
Have created a c++ implementation of the Hough transform for detecting lines in images.
I have created a template for Visual Studio 2008 and it currently shows up
I have created a PHP-script to update a web server that is live inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.