aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/workbenches_controller.rb
diff options
context:
space:
mode:
authorcedricnjanga2017-09-05 14:26:20 +0200
committercedricnjanga2017-09-05 14:36:47 +0200
commitdf7552799d16d5686e389e484a00e0a7e8fb4e1d (patch)
treea8fb56d2e41aef844cdfb5790417eaba07430fb8 /app/controllers/workbenches_controller.rb
parent70e8e93b0ebf4596c0ffd64620415db2450f4595 (diff)
downloadchouette-core-df7552799d16d5686e389e484a00e0a7e8fb4e1d.tar.bz2
Referential#new_from :
Added params to certains paths to have the workbench_id in it. The goal is to have the current workbench_id to assign it when do a Referential#new_from Then I finished the use of the functional scope to avoid potential errors I skipped some tests that hve a #TODO so we can easily find them
Diffstat (limited to 'app/controllers/workbenches_controller.rb')
-rw-r--r--app/controllers/workbenches_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index 19af28a98..bae3fcff2 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -20,8 +20,13 @@ class WorkbenchesController < BreadcrumbController
@q_for_form = scope.ransack(params[:q])
@q_for_result = scope.ransack(ransack_params)
@wbench_refs = sort_result(@q_for_result.result).paginate(page: params[:page], per_page: 30)
- @wbench_refs = ModelDecorator.decorate(@wbench_refs, with: ReferentialDecorator)
-
+ @wbench_refs = ModelDecorator.decorate(
+ @wbench_refs,
+ with: ReferentialDecorator,
+ context: {
+ workbench_id: params[:id]
+ }
+ )
show! do
build_breadcrumb :show
end