aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/referentials_controller.rb18
-rw-r--r--app/controllers/workbenches_controller.rb2
2 files changed, 13 insertions, 7 deletions
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
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index b23e9202e..b2bf5eab8 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -4,7 +4,7 @@ class WorkbenchesController < BreadcrumbController
respond_to :html, :only => [:show]
def show
- @wbench_refs = Workbench.find(params[:id]).referentials.paginate(page: params[:page], per_page: 2)
+ @wbench_refs = Workbench.find(params[:id]).referentials.paginate(page: params[:page], per_page: 20)
show! do
build_breadcrumb :show