summaryrefslogtreecommitdiff
path: root/app/helpers/table_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/table_helper.rb')
-rw-r--r--app/helpers/table_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/table_helper.rb b/app/helpers/table_helper.rb
new file mode 100644
index 0000000..16a7019
--- /dev/null
+++ b/app/helpers/table_helper.rb
@@ -0,0 +1,13 @@
+module TableHelper
+
+ # we do the translation here so the .key lookup is relative
+ # to the partial the helper was called from.
+ def table(content, columns)
+ render 'common/table',
+ content: content,
+ columns: columns,
+ headers: columns.map {|h| t(".#{h}", cascading: true) },
+ none: t('.none', cascading: true)
+ end
+
+end