From 39dfc10a76f15f1a89e62f2fa6f22cb970b5e438 Mon Sep 17 00:00:00 2001 From: Xero Date: Wed, 6 Mar 2024 10:14:45 -0500 Subject: [PATCH] allow common name to be modifiable via ui for plants --- app/controllers/plants_controller.rb | 2 +- app/views/plants/_form.html.erb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/plants_controller.rb b/app/controllers/plants_controller.rb index 6856d91..096cedc 100644 --- a/app/controllers/plants_controller.rb +++ b/app/controllers/plants_controller.rb @@ -68,6 +68,6 @@ def set_plant # Only allow a list of trusted parameters through. def plant_params - params.require(:plant).permit([:name, :family_id, :genus_id, :status_id, :year_acquired]) + params.require(:plant).permit([:name, :family_id, :genus_id, :status_id, :year_acquired, :common_name]) end end diff --git a/app/views/plants/_form.html.erb b/app/views/plants/_form.html.erb index cfcbb82..85f8ea3 100644 --- a/app/views/plants/_form.html.erb +++ b/app/views/plants/_form.html.erb @@ -12,6 +12,7 @@ <% end %> <%= form.text_field :name %> + <%= form.text_field :common_name %> <%= collection_select(:plant, :family_id, Family.all.sort_by(&:name), :id, :name, prompt: true) %> <%= collection_select(:plant, :genus_id, Genus.all.sort_by(&:name), :id, :name, prompt: true) %> <%= collection_select(:plant, :status_id, Status.all, :id, :name, prompt: true) %>