aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-03-01 17:16:59 +0100
committerXinhui2017-03-01 17:17:06 +0100
commit5e350204ba6da50c78cf82e652b76698a852fde2 (patch)
treed92cbb388e8e00c77b809c2b60904595694800ec
parent49a472835bf5bfe57c711dfd20b8e1a44afd6264 (diff)
downloadchouette-core-5e350204ba6da50c78cf82e652b76698a852fde2.tar.bz2
Workbench#delete_referentials action
-rw-r--r--app/controllers/workbenches_controller.rb7
-rw-r--r--config/locales/referentials.en.yml2
-rw-r--r--config/locales/referentials.fr.yml2
3 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index 8987c7b01..3818ea866 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -16,8 +16,11 @@ class WorkbenchesController < BreadcrumbController
end
def delete_referentials
- ap params
- ap '-----------------'
+ referentials = resource.referentials.where(id: params[:referentials])
+ if referentials.destroy_all
+ flash[:notice] = t('notice.referentials.deleted')
+ end
+ redirect_to resource
end
private
diff --git a/config/locales/referentials.en.yml b/config/locales/referentials.en.yml
index 183518094..2c28d04a2 100644
--- a/config/locales/referentials.en.yml
+++ b/config/locales/referentials.en.yml
@@ -107,6 +107,8 @@ en:
end: 'Period end'
notice:
+ referentials:
+ deleted: "Datasets has been successfully destroyed"
referential:
archived: "The data space has been successfully archived"
unarchived: "The data space has been successfully unarchived"
diff --git a/config/locales/referentials.fr.yml b/config/locales/referentials.fr.yml
index 13e3d3d18..17ea64a56 100644
--- a/config/locales/referentials.fr.yml
+++ b/config/locales/referentials.fr.yml
@@ -107,6 +107,8 @@ fr:
end: 'Fin de période'
notice:
+ referentials:
+ deleted: "Les jeux de données on été supprimés"
referential:
archived: "Le jeu de données a été correctement archivé"
unarchived: "Le jeu de données a été correctement désarchivé"