Skip to content

Commit

Permalink
Added: Displays attached file in #show
Browse files Browse the repository at this point in the history
  • Loading branch information
AidenEscamilla committed Feb 7, 2024
1 parent 90bc94d commit 06aa925
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
14 changes: 14 additions & 0 deletions job_tracker/app/views/supporting_documents/_attachment.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<% if supporting_document.document.attached? %>
<ul>
<li>
<%= link_to "#{supporting_document.document.filename}", supporting_document.document%>
</li>
</ul>
<div class="row">
<% if supporting_document.document.image?%>
<div class="message-image-container">
<%= image_tag(supporting_document.document, class:"message-image") %>
</div>
<% end %>
</div>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
</p>

<p>
<strong>Documents:</strong>
<%= link_to supporting_document.document.filename, supporting_document.document if supporting_document.document.attached? %>
<strong>Job application:</strong>
<%= link_to "#{supporting_document.job_application.job_title}", job_application_path(supporting_document.job_application) %>
</p>


<p>
<strong>Job application:</strong>
<%= link_to "#{supporting_document.job_application.job_title}", job_application_path(supporting_document.job_application) %>
<strong>Documents:</strong>
</p>

<%= render "supporting_documents/attachment", supporting_document: supporting_document%>

</div>

0 comments on commit 06aa925

Please sign in to comment.