From a6f8318aa267e3723eb4c10647447ff08cd5fdca Mon Sep 17 00:00:00 2001 From: jpl Date: Fri, 18 Nov 2016 18:15:06 +0100 Subject: Refs #1989: Adding and fixing actions --- app/controllers/referentials_controller.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'app/controllers/referentials_controller.rb') diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index ab494ac2e..74eb36aa6 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -15,10 +15,9 @@ class ReferentialsController < BreadcrumbController end end - def create - - create! - end + # def create + # create! + # end def show resource.switch @@ -34,13 +33,20 @@ class ReferentialsController < BreadcrumbController end end + def destroy + workbench = referential.workbench_id + + referential.destroy! + redirect_to workbench_path(workbench), notice: t('notice.referential.deleted') + end + def archive referential.archive! - redirect_to referential_path, notice: t('notice.referential.archived') + redirect_to workbench_path(referential.workbench_id), notice: t('notice.referential.archived') end def unarchive referential.unarchive! - redirect_to referential_path, notice: t('notice.referential.unarchived') + redirect_to workbench_path(referential.workbench_id), notice: t('notice.referential.unarchived') end protected -- cgit v1.2.3