diff --git a/app/models/metadata_array.rb b/app/models/metadata_array.rb index a1ff8c72..b65fd34e 100644 --- a/app/models/metadata_array.rb +++ b/app/models/metadata_array.rb @@ -7,6 +7,12 @@ class MetadataArray < MetadataTemplate super || [] end + # Los Arrays no se pueden cifrar todavĂ­a + # TODO: Cifrar y decifrar arrays + def private? + false + end + private def sanitize(values) @@ -16,6 +22,6 @@ class MetadataArray < MetadataTemplate else v end - end + end.select(&:present?) end end diff --git a/app/views/posts/attributes/_array.haml b/app/views/posts/attributes/_array.haml index 73e96dea..da9ec654 100644 --- a/app/views/posts/attributes/_array.haml +++ b/app/views/posts/attributes/_array.haml @@ -1,5 +1,6 @@ .form-group = 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, name: "#{base}[#{attribute}][]", list: id_for_datalist(attribute),