From e1961c5cad450517dbcc14e7a0f9812dbc578953 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 21 Jun 2018 14:35:41 -0300 Subject: [PATCH] opciones de select2 para categories y tags --- app/views/posts/_form.haml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index 6e06ca9a..f772b09e 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -44,12 +44,18 @@ = label_tag 'post_categories', t('posts.categories') = select_tag 'post[categories][]', options_for_select(@site.categories(lang: @lang), @post.categories), - { class: 'form-control select2', multiple: 'multiple' } + { class: 'form-control select2', multiple: 'multiple', + data: { tags: true, + placeholder: t('posts.select.placeholder'), + 'allow-clear': true } } .form-group = label_tag 'post_tags', t('posts.tags') = select_tag 'post[tags][]', options_for_select(@site.tags(lang: @lang), @post.tags), - { class: 'form-control select2', multiple: 'multiple' } + { class: 'form-control select2', multiple: 'multiple', + data: { tags: true, + placeholder: t('posts.select.placeholder'), + 'allow-clear': true } } .form-group = label_tag 'post_slug', t('posts.slug') = text_field 'post', 'slug', value: @post.slug,