aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/newapplication_helper.rb
diff options
context:
space:
mode:
authorjpl2017-03-15 15:34:15 +0100
committerjpl2017-03-15 15:34:29 +0100
commit0e88a03798edc961c9a63b9407c50e07df83ce57 (patch)
treebd7ed432a1140451e4e25112ed8e5a719e873540 /app/helpers/newapplication_helper.rb
parentfa2fbe3f09b0330cb8b4e45a8f9b2c435c1a18b1 (diff)
downloadchouette-core-0e88a03798edc961c9a63b9407c50e07df83ce57.tar.bz2
Refs #2800: updating table_builder to fix some issues in sortable columns (first pass)
Diffstat (limited to 'app/helpers/newapplication_helper.rb')
-rw-r--r--app/helpers/newapplication_helper.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb
index 11c794ea3..e52f0320f 100644
--- a/app/helpers/newapplication_helper.rb
+++ b/app/helpers/newapplication_helper.rb
@@ -16,7 +16,11 @@ module NewapplicationHelper
end
columns.map do |k, v|
- hcont << content_tag(:th, sortable_columns(collection, k))
+ if k.is_a? Symbol
+ hcont << content_tag(:th, sortable_columns(collection, k))
+ else
+ hcont << content_tag(:th, k)
+ end
end
hcont << content_tag(:th, '') if actions.any?
@@ -166,7 +170,9 @@ module NewapplicationHelper
pic2 = content_tag :span, '', class: "fa fa-sort-desc #{(direction == 'asc') ? 'active' : ''}"
pics = content_tag :span, pic1 + pic2, class: 'orderers'
- (key.to_s + pics).html_safe
+ obj = collection.model.to_s.gsub('Chouette::', '').scan(/[A-Z][a-z]+/).join('_').downcase
+
+ (I18n.t("activerecord.attributes.#{obj}.#{key}") + pics).html_safe
end
end