File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
app/helpers/catalog_helper Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1
1
module CatalogHelper ::TextualSummary
2
2
def tags_from_record
3
3
tags = [ ]
4
+ tag_categories = Hash . new { |h , k | h [ k ] = [ ] }
4
5
@record . tags . each do |tag |
5
6
values = tag . name . split ( '/' )
6
7
p = tags . find { |x | x [ :label ] == values [ 2 ] . humanize }
@@ -9,9 +10,12 @@ def tags_from_record
9
10
p [ :value ] . push ( value )
10
11
else
11
12
name = Classification . find_by ( :id => Classification . find_by ( :tag_id => tag . id ) . parent_id ) . description
12
- tags . push ( :icon => "fa fa-tag" , :label => name , :value => [ value ] )
13
+ tag_categories [ name ] << value
13
14
end
14
15
end
16
+ tag_categories . each do |tag_category , tag_values |
17
+ tags . push ( :icon => "fa fa-tag" , :label => tag_category , :value => tag_values )
18
+ end
15
19
tags
16
20
end
17
21
You can’t perform that action at this time.
0 commit comments