diff --git a/app/controllers/plants_controller.rb b/app/controllers/plants_controller.rb index e85b0b2..6856d91 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]) + params.require(:plant).permit([:name, :family_id, :genus_id, :status_id, :year_acquired]) end end diff --git a/app/views/plants/_form.html.erb b/app/views/plants/_form.html.erb index 7916cb4..cfcbb82 100644 --- a/app/views/plants/_form.html.erb +++ b/app/views/plants/_form.html.erb @@ -15,6 +15,7 @@ <%= 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) %> + <%= number_field(:plant, :year_acquired, in: (2017..2050)) %>
<%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>