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) %>