% content_for :title, "Crop Allocation" %>
Click on a bed row or an individual raft to update the corresponding crop.
<%= form_with url: bulk_assign_crops_beds_path, method: :patch, local: true do %>Bed | <% max_cols = @beds.map { |b| b.rafts.count }.max %> <% (1..max_cols).each do |i| %>R<%= i %> | <% end %>
---|---|
<%= link_to bed.location, edit_bed_path(bed), class: "btn btn-outline-secondary" %> | <% bed.rafts.each do |raft| %><%= link_to (raft&.crop&.name || "—"), edit_raft_path(raft), class: "btn btn-sm" %> | <% end %>