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 +++++ app/controllers/referential_networks_controller.rb | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'app/controllers') 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 diff --git a/app/controllers/referential_networks_controller.rb b/app/controllers/referential_networks_controller.rb index 30c7dd244..8426c6ba3 100644 --- a/app/controllers/referential_networks_controller.rb +++ b/app/controllers/referential_networks_controller.rb @@ -10,7 +10,15 @@ class ReferentialNetworksController < ChouetteController def show @map = NetworkMap.new(resource).with_helpers(self) + show! do + @network = ReferentialNetworkDecorator.decorate( + @network, + context: { + referential: referential + } + ) + build_breadcrumb :show end end -- cgit v1.2.3