5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 08:51:41 +00:00

obtener los valores de los select anidados

This commit is contained in:
f 2018-06-26 20:27:15 -03:00
parent c26cca5fa0
commit e1d7abd254
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7

View file

@ -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?,