diff --git a/app/controllers/glossary_terms_controller.rb b/app/controllers/glossary_terms_controller.rb index 21ec472..b60ac9a 100644 --- a/app/controllers/glossary_terms_controller.rb +++ b/app/controllers/glossary_terms_controller.rb @@ -1,6 +1,6 @@ class GlossaryTermsController < ApplicationController - before_action :find_term_from_id, only: [:show, :edit, :update] + before_action :find_term_from_id, only: [:show, :edit, :update, :destroy] def index @glossary_terms = GlossaryTerm.all @@ -30,6 +30,11 @@ class GlossaryTermsController < ApplicationController rescue ActiveRecord::StaleObjectError flash.now[:error] = l(:notice_locking_conflict) end + + def destroy + @term.destroy + redirect_to glossary_terms_path + end # Find the term whose id is the :id parameter def find_term_from_id diff --git a/app/views/glossary_terms/show.html.erb b/app/views/glossary_terms/show.html.erb index 7fc0140..85a366b 100644 --- a/app/views/glossary_terms/show.html.erb +++ b/app/views/glossary_terms/show.html.erb @@ -1,5 +1,7 @@