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 11module CatalogHelper ::TextualSummary
22 def tags_from_record
33 tags = [ ]
4+ tag_categories = Hash . new { |h , k | h [ k ] = [ ] }
45 @record . tags . each do |tag |
56 values = tag . name . split ( '/' )
67 p = tags . find { |x | x [ :label ] == values [ 2 ] . humanize }
@@ -9,9 +10,12 @@ def tags_from_record
910 p [ :value ] . push ( value )
1011 else
1112 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
1314 end
1415 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
1519 tags
1620 end
1721
You can’t perform that action at this time.
0 commit comments