aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorTeddy Wing2017-06-09 15:37:31 +0200
committerTeddy Wing2017-06-09 15:37:31 +0200
commit31805920c4ec9366d37a6b00d3dc8e48db72ea9f (patch)
tree8e421639483630c4cae195e1d59315a9a0c5d9f6 /app
parentaba69469b1eb19d5347fb9cf1d7d28efe055d33f (diff)
downloadchouette-core-31805920c4ec9366d37a6b00d3dc8e48db72ea9f.tar.bz2
TableBuilderHelper#thead: Change `links` argument to `has_links`
Since this method doesn't depend on the actual list of links, don't ask for it as an argument. Instead, just pass the answer to "are there any links?". Refs #3479
Diffstat (limited to 'app')
-rw-r--r--app/helpers/table_builder_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb
index ef728a12d..95c84d50e 100644
--- a/app/helpers/table_builder_helper.rb
+++ b/app/helpers/table_builder_helper.rb
@@ -18,14 +18,14 @@ module TableBuilderHelper
)
content_tag :table,
- thead(collection, columns, selectable, links) +
+ thead(collection, columns, selectable, links.any?) +
tbody(collection, columns, selectable, links),
class: cls
end
private
- def thead(collection, columns, selectable, links)
+ def thead(collection, columns, selectable, has_links)
content_tag :thead do
content_tag :tr do
hcont = []
@@ -44,7 +44,7 @@ module TableBuilderHelper
end
end
# Inserts a blank column for the gear menu
- hcont << content_tag(:th, '') if links.any?
+ hcont << content_tag(:th, '') if has_links
hcont.join.html_safe
end