From ccbd1cfa43662933991dd85bef072e5ca0ae77c7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 11 Jul 2017 17:05:59 +0200 Subject: Networks#show: Move header links into a decorator In order to allow us to use these links in tables of networks via the new table builder, move the link definitions into decorator `#action_links`. This changes both of these types of pages: * http://stif-boiv.dev:3000/referentials/4/networks/118 * http://stif-boiv.dev:3000/line_referentials/1/networks/118 Refs #3479 --- app/controllers/networks_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/controllers/networks_controller.rb') diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb index ea8410c5b..2e2f3f0d1 100644 --- a/app/controllers/networks_controller.rb +++ b/app/controllers/networks_controller.rb @@ -12,7 +12,12 @@ class NetworksController < BreadcrumbController def show @map = NetworkMap.new(resource).with_helpers(self) + show! do + @network = @network.decorate(context: { + line_referential: line_referential + }) + build_breadcrumb :show end end -- cgit v1.2.3 From dc155d36bdf0dc1c056888794586fca10c1f11b0 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 11 Jul 2017 17:28:19 +0200 Subject: Networks#index: Use new table builder helper on both networks tables Refs #3479 --- app/controllers/networks_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/controllers/networks_controller.rb') diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb index 2e2f3f0d1..d1f83340e 100644 --- a/app/controllers/networks_controller.rb +++ b/app/controllers/networks_controller.rb @@ -36,6 +36,14 @@ class NetworksController < BreadcrumbController if collection.out_of_bounds? redirect_to params.merge(:page => 1) end + + @networks = ModelDecorator.decorate( + @networks, + with: NetworkDecorator, + context: { + line_referential: line_referential + } + ) } build_breadcrumb :index end -- cgit v1.2.3