sutty/app/views/posts/attributes/_boolean.haml

13 lines
518 B
Plaintext
Raw Normal View History

2019-08-23 18:29:07 +00:00
.form-check
2020-09-01 21:48:28 +00:00
= hidden_field_tag "post[#{attribute}]", '0', id: ''
.custom-control.custom-switch
= check_box_tag "post[#{attribute}]", '1', metadata.value,
class: "custom-control-input #{invalid(post, attribute)}",
aria: { describedby: id_for_help(attribute) },
autofocus: autofocus
= label_tag "post_#{attribute}", post_label_t(attribute, post: post),
class: 'custom-control-label'
2019-08-20 22:11:10 +00:00
2020-09-01 21:48:28 +00:00
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata