aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/lines_controller.rb
diff options
context:
space:
mode:
authorTeddy Wing2017-07-03 18:34:58 +0200
committerTeddy Wing2017-07-06 12:30:59 +0200
commit205ce7c3fbdb025edc62a74b87d26cc237545f36 (patch)
treead01ab581491f6b057b21f51a7175cf183a63dcd /app/controllers/lines_controller.rb
parent2d26c10de73fd6bfbf575dafee7b72e97844ff6b (diff)
downloadchouette-core-205ce7c3fbdb025edc62a74b87d26cc237545f36.tar.bz2
Lines#index: Use new `table_builder_2`
Convert the table of Lines to use the new version of the table builder. Update the view with the new calling format of the helper. The controller needs to decorate the `@lines` collection in order to make `#action_links` available to the table builder. Needed to update the "_filters.html.slim" template to call `#human_attribute_name` on the class instead of the collection, because we can't do that on a decorated collection. Refs #3479
Diffstat (limited to 'app/controllers/lines_controller.rb')
-rw-r--r--app/controllers/lines_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb
index 1e2056aad..4b6448ce8 100644
--- a/app/controllers/lines_controller.rb
+++ b/app/controllers/lines_controller.rb
@@ -13,6 +13,15 @@ class LinesController < BreadcrumbController
def index
@hide_group_of_line = line_referential.group_of_lines.empty?
index! do |format|
+ @lines = ModelDecorator.decorate(
+ @lines,
+ with: LineDecorator,
+ context: {
+ line_referential: @line_referential,
+ current_organisation: current_organisation
+ }
+ )
+
format.html {
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)