aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorTeddy Wing2017-09-01 14:51:07 +0200
committerTeddy Wing2017-09-01 14:52:53 +0200
commit7f85e8bbb15ec4063dad8b080e61d690b77dead7 (patch)
treeb183000bb3e68134e4d77988ebc17c8d8d623b72 /app/helpers
parent9574d8b8351fd59eeada05a1ba71893a82b86989 (diff)
downloadchouette-core-7f85e8bbb15ec4063dad8b080e61d690b77dead7.tar.bz2
TableBuilderHelper::Column: Add `#linkable?` method
This tells the markup assembler whether or not this column should be wrapped in a link (`<a>`). It intends to serve the same purpose as `TableBuilderHelper#column_is_linkable`, but at the column level. The idea is to remove that method when these links only operate by column and not by pre-defined values like before/now.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/table_builder_helper/column.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/table_builder_helper/column.rb b/app/helpers/table_builder_helper/column.rb
index ef3c0b629..b4c569882 100644
--- a/app/helpers/table_builder_helper/column.rb
+++ b/app/helpers/table_builder_helper/column.rb
@@ -31,6 +31,10 @@ module TableBuilderHelper
I18n.t("activerecord.attributes.#{model_key}.#{@key}")
end
+ def linkable?
+ !@link_to.nil?
+ end
+
def link_to(obj)
@link_to.call(obj)
end