5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 09:31:43 +00:00

no repetir los campos que son hashes #51

This commit is contained in:
f 2018-06-27 19:03:21 -03:00
parent 5f27e09eda
commit abc4bd6921
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7

View file

@ -13,6 +13,8 @@
- else
-# Obtenemos todos los valores. Puede ser un Hash o un Array
- groups = @post.get_front_matter(template.key)
- if groups.is_a? Hash
- groups = [ groups ]
- groups.each_with_index do |group, i|
-# A partir del segundo grupo todos son extra
- classes = (i > 0) ? [template.key, 'extra'] : [template.key]
@ -41,7 +43,7 @@
-# Si el campo es un array, groups es un array de hashes
-# y group un hash. De lo contrarios, groups va a ser un
-# Hash
- value = template.array? ? group[nf.key] : groups[nf.key]
- value = (template.array? || template.nested?) ? group[nf.key] : groups[nf.key]
= render 'posts/template_field/nested',
template: nf,
value: value,