5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 07:36:22 +00:00
panel/app/views/posts/template_field/_check_box_group.haml

13 lines
433 B
Text
Raw Permalink Normal View History

2018-12-14 16:04:45 +00:00
-# Obtener el nombre del campo
- field_name = field_name_for_post_as_string(name)
-# Obtener todos los valores
- value = [] if value.nil?
- values = template.values.empty? ? [value].flatten : template.values
- values.each do |v|
.form-check
= check_box_tag field_name+'[]',
v,
@post.fetch_front_matter(name, []).include?(v),
class: 'form-check-input'
= label_tag field_name, v, class: 'form-check-label'