diff --git a/app/models/project.rb b/app/models/project.rb index e72d6ada3..da266594d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -250,20 +250,26 @@ class Project < ApplicationRecord .add_child('
').first # Add header row + header_cell = ''\ + '
'\ + '%s'\ + '
'\ + '' header_el = table_el.add_child('').first row_el = header_el.add_child('').first - row_el.add_child('
').first + row_el.add_child(format(header_cell, '')).first table_headers.each do |col| - row_el.add_child("
#{col}
").first + row_el.add_child(format(header_cell, col)).first end # Add body rows + body_cell = '%s' body_el = table_el.add_child('').first - table_data.each.with_index(1) do |row, index| + table_data.each.with_index(1) do |row, idx| row_el = body_el.add_child('').first - row_el.add_child("
#{index}
").first + row_el.add_child(format(header_cell, idx)).first row.each do |col| - row_el.add_child("#{col}").first + row_el.add_child(format(body_cell, col)).first end end end