Bed | <% max_cols = @beds.map { |b| b.rafts.count }.max %> <% (1..max_cols).each do |i| %>R<%= i %> | <% end %>
---|---|
<%= bed.location %> | <% bed.rafts.order(:location).each do |raft| %><% if raft.crop %> <%= raft.crop.name %> <% else %> — <% end %> | <% end %>
Raft | Crop | Actions |
---|---|---|
<%= raft.location %> | <%= form_with url: assign_one_raft_path(raft), method: :patch, class: "d-flex gap-2", data: { turbo: false } do %> <% end %> | <%= button_to "Clear", assign_one_raft_path(raft, crop_id: ""), method: :patch, form: { data: { turbo: false } }, class: "btn btn-outline-secondary btn-sm" %> |