app/views/studies/asset_groups/show.html.erb
<%- add :menu, "Back to Study" => study_path(@study) -%>
<h3>Name: <%= @asset_group.name %></h3>
<div id=assets>
<table class="hover_table">
<thead>
<th width="5%">Asset Name</th>
<th width="5%">Sample Names</th>
<th width="5%">Asset Type</th>
<th width="5%">Asset Barcode</th>
</thead>
<% @asset_group.assets.each do |asset| -%>
<tr>
<td><%= link_to(h(asset.display_name), receptacle_path(asset)) %></td>
<td>
<% asset.aliquots.each do |aliquot| %>
<%= link_to aliquot.sample.name, sample_path(aliquot.sample) %>
<% end %>
</td>
<td><%= asset.label %></td>
<% unless asset.barcode_number.nil? %>
<td><%= "Barcode: #{asset.barcode_number}" %></td>
<% else %>
<td></td>
<% end %>
</tr>
<% end %>
</table>
</div>
<hr />
<% if can? :create, @asset_group %>
<%= form_for @asset_group, url: search_study_asset_group_path(@study, @asset_group), html: {method: :post} do |f| %>
<p><%= label_tag(:q, 'Search for assets to add to group') %>: <%= text_field_tag :q %> <%= f.submit "Search" %></p>
<% end %>
<hr />
<% end %>
<div class='section'>
<% if can? :edit, AssetGroup %>
<%= link_to 'Edit', edit_study_asset_group_path(@study, @asset_group) %> |
<% end %>
<%= link_to 'Back', study_asset_groups_path(@study) %>
</div>