poder vaciar arrays closes #219

This commit is contained in:
f 2021-02-11 12:13:18 -03:00
parent 360b999dcb
commit 419749b912
2 changed files with 8 additions and 1 deletions

View file

@ -7,6 +7,12 @@ class MetadataArray < MetadataTemplate
super || [] super || []
end end
# Los Arrays no se pueden cifrar todavía
# TODO: Cifrar y decifrar arrays
def private?
false
end
private private
def sanitize(values) def sanitize(values)
@ -16,6 +22,6 @@ class MetadataArray < MetadataTemplate
else else
v v
end end
end end.select(&:present?)
end end
end end

View file

@ -1,5 +1,6 @@
.form-group .form-group
= label_tag "#{base}_#{attribute}", post_label_t(attribute, post: post) = label_tag "#{base}_#{attribute}", post_label_t(attribute, post: post)
= hidden_field_tag "#{base}[#{attribute}][]", ''
.taggable{ dir: dir, lang: locale, data: { values: metadata.value.to_json, .taggable{ dir: dir, lang: locale, data: { values: metadata.value.to_json,
name: "#{base}[#{attribute}][]", list: id_for_datalist(attribute), name: "#{base}[#{attribute}][]", list: id_for_datalist(attribute),