From cc83cb23bc2afdc23c5641beb36aea5dfe0b0a38 Mon Sep 17 00:00:00 2001 From: Brenda Date: Sun, 1 Mar 2020 07:57:04 +1300 Subject: [PATCH] fix plant part selection bug on editing harvests --- app/views/harvests/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/harvests/_form.html.haml b/app/views/harvests/_form.html.haml index aa6b56e09..833cd59ac 100644 --- a/app/views/harvests/_form.html.haml +++ b/app/views/harvests/_form.html.haml @@ -37,7 +37,7 @@ = f.form_group :plant_part_id, label: { text: "Harvested Plant Part" } do .row - PlantPart.all.order(:name).pluck(:id, :name).each do |id, name| - .col-4.col-md-3= f.radio_button :plant_part_id, id, label: name, checked: true + .col-4.col-md-3= f.radio_button :plant_part_id, id, label: name, checked: (id == @planting.plant_part_id) -# Some browsers (eg Firefox for Android) assume "number" means -# "integer" unless you specify step="any":