aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorTeddy Wing2017-06-14 12:00:40 +0200
committerTeddy Wing2017-06-14 12:00:40 +0200
commitcd510d491181eb7a65559b9bbab600316e4f7b7b (patch)
treeac22b09a0fb42b2140adf8c937b7575e8a2cbeef /app/helpers
parent5266d9099b0cc82bfab20417d382e4324cdab013 (diff)
downloadchouette-core-cd510d491181eb7a65559b9bbab600316e4f7b7b.tar.bz2
TableBuilderHelper#tbody: Move condition to method
Give this check a clearer name. Refs #3479
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/table_builder_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb
index b65747056..ef44d98c7 100644
--- a/app/helpers/table_builder_helper.rb
+++ b/app/helpers/table_builder_helper.rb
@@ -96,7 +96,7 @@ module TableBuilderHelper
columns.map do |column|
value = column.value(item)
- if column.attribute == 'name' || column.attribute == 'comment'
+ if column_is_linkable?(column)
# Build a link to the `item`
polymorph_url = polymorphic_url_parts(item)
bcont << content_tag(:td, link_to(value, polymorph_url), title: 'Voir')
@@ -243,6 +243,10 @@ module TableBuilderHelper
end
end
+ def column_is_linkable?(column)
+ column.attribute == 'name' || column.attribute == 'comment'
+ end
+
def polymorphic_url_parts(item)
polymorph_url = []