diff --git a/app/views/posts/template_field/_table.haml b/app/views/posts/template_field/_table.haml index dff4fe0a..a0bc0792 100644 --- a/app/views/posts/template_field/_table.haml +++ b/app/views/posts/template_field/_table.haml @@ -26,10 +26,11 @@ = fa_icon 'close', title: t('posts.row.del', group: template.key.humanize) = t('posts.row.del', group: template.key.humanize) -# Separar los campos en dos columnas - - template.nested_fields.each_slice(template.cols || 2).to_a.each do |col| + - cols = template.cols || 2 + - template.nested_fields.each_slice(cols).to_a.each do |col| .form-row{class: "align-items-#{template.align || 'start'}"} - col.each do |nf| - .col-md + %div{class: "col-md-#{12/cols}"} -# Si el template es un array, quiere decir que esperamos un array de hashes. -# El valor vacĂ­o luego es reemplazado por un id temporal