aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorjpl2016-11-18 18:15:06 +0100
committerjpl2016-11-18 18:15:28 +0100
commita6f8318aa267e3723eb4c10647447ff08cd5fdca (patch)
tree4a6bf28847bd59569e5742cd561fb8069b4d154c /app/controllers
parent3037777de01ce7cc78493031e0242a81af5d3872 (diff)
downloadchouette-core-a6f8318aa267e3723eb4c10647447ff08cd5fdca.tar.bz2
Refs #1989: Adding and fixing actions
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