File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
app/helpers/catalog_helper Expand file tree Collapse file tree 1 file changed +9
-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 = { }
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,16 @@ 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
+ if tag_categories [ name ] . nil?
14
+ tag_categories [ name ] = [ value ]
15
+ else
16
+ tag_categories [ name ] . append ( value )
17
+ end
13
18
end
14
19
end
20
+ tag_categories . each do |tag_category , tag_values |
21
+ tags . push ( :icon => "fa fa-tag" , :label => tag_category , :value => tag_values )
22
+ end
15
23
tags
16
24
end
17
25
You can’t perform that action at this time.
0 commit comments