From 5d89afdd649d6cf685e7725e2969816088d1d322 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 14 Dec 2018 10:52:22 -0300 Subject: [PATCH] =?UTF-8?q?agregar=20opci=C3=B3n=20"en=20blanco"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/posts/template_field/_select.haml | 2 +- config/locales/en.yml | 1 + config/locales/es.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/posts/template_field/_select.haml b/app/views/posts/template_field/_select.haml index 2bd0374..60bf351 100644 --- a/app/views/posts/template_field/_select.haml +++ b/app/views/posts/template_field/_select.haml @@ -1,7 +1,7 @@ - value = [] if value.nil? - values = template.values.empty? ? [value].flatten : template.values = select_tag field_name_for_post_as_string(name), - options_for_select(values, value), + options_for_select([t('posts.blank'), nil] + values, value), { class: 'form-control select2', multiple: template.multiple?, required: template.required?, diff --git a/config/locales/en.yml b/config/locales/en.yml index 85c58b8..1b6e826 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -243,3 +243,4 @@ en: url: 'The address must start with http:// or https://' invalid_help: It looks like the form is incomplete. Check the red-colored fields to complete it. sending_help: Saving, please wait... + blank: Nothing diff --git a/config/locales/es.yml b/config/locales/es.yml index 65a7a6d..ac8b320 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -250,3 +250,4 @@ es: url: 'La dirección debe comenzar con http:// o https://' invalid_help: Parece que el formulario no está completo. Verifica los campos marcados en rojo para completarlo. sending_help: Guardando, por favor espera... + blank: En blanco