app/views/qc_reports/_qc_reports.html.erb
<table class="qc_reports detailed table table-striped">
<thead>
<tr>
<th>Study</th>
<th>Product</th>
<th>State</th>
<th>Created at</th>
<th>View</th>
<th>Download</th>
</tr>
</thead>
<tbody>
<% qc_reports.each do |report| %>
<tr>
<td><%= report.study.name %></td>
<td><%= report.product.name %></td>
<td><%= report.state.humanize %></td>
<td><%= report.created_at.to_formatted_s(:sortable) %></td>
<td><%= link_to('Show',report) %></td>
<td><%= link_to('Download',qc_report_path(report,format: :csv)) if report.available? %></td>
</tr>
<% end %>
</tbody>
</table>