diff --git a/app/views/posts/template_field/_select.haml b/app/views/posts/template_field/_select.haml index f9a6bbe..2f5c1b4 100644 --- a/app/views/posts/template_field/_select.haml +++ b/app/views/posts/template_field/_select.haml @@ -1,5 +1,10 @@ +- if name.is_a?(Array) && name.count == 3 + - value = @post.get_front_matter(name.first).try(:[], name.second.to_i).try(:[], name.last) +- else + - value = @post.get_front_matter(template.key) +- values = template.values.empty? ? value : template.values = select_tag field_name_for_post_as_string(name), - options_for_select(template.values, @post.get_front_matter(template)), + options_for_select(values, value), { class: 'form-control select2', multiple: template.multiple?, required: template.required?,