aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/routes
diff options
context:
space:
mode:
authorTeddy Wing2017-09-01 16:47:10 +0200
committerTeddy Wing2017-09-01 17:22:41 +0200
commite115d2cf86c285f66af37aa8ca66d63eb4144294 (patch)
tree608476779efc882d7ca6eb459f72c4d90cea0639 /app/views/routes
parent28db706443a912e8355e4c48488dc40c403e7f76 (diff)
downloadchouette-core-e115d2cf86c285f66af37aa8ca66d63eb4144294.tar.bz2
table_builder_2: Use `Column#link_to` in all table builder calls
Rewrite table builder calls to work with the new `TableBuilderHelper::Column#link_to` mechanism for defining the linked column and what it points to. This takes the link out of the `TableBuilderHelper`, and puts it into the hands of the view. It gives us more flexibility with regards to what can be defined as a link in our tables and what those links point to. This will be used in a more meaningful way in the `imports#show` page to list `NetexImport`s and provide links to both the referential associated with a Netex import and the imported file status page from a table row.
Diffstat (limited to 'app/views/routes')
-rw-r--r--app/views/routes/show.html.slim5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index 1e3fac723..a21b5ec8a 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -41,7 +41,10 @@
), \
TableBuilderHelper::Column.new( \
key: :name, \
- attribute: Proc.new {|s| s.try(:stop_area).try(:name)} \
+ attribute: Proc.new {|s| s.try(:stop_area).try(:name)}, \
+ link_to: lambda do |stop_point| \
+ referential_stop_area_path(@referential, stop_point.stop_area) \
+ end \
), \
TableBuilderHelper::Column.new( \
key: :deleted_at, \