5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 07:56:23 +00:00

feat: poder modificar atributos del custom-input

This commit is contained in:
f 2024-05-17 14:59:23 -03:00
parent 5f5026bcca
commit c75deaf030
No known key found for this signature in database

View file

@ -1,6 +1,9 @@
- help_id = "#{id}_help" - help_id = "#{id}_help"
- checkbox_attributes = local_assigns.slice(:id, :type, :name, :value, :required, :checked)
- checkbox_attributes[:type] ||= 'checkbox'
.custom-control.custom-checkbox .custom-control.custom-checkbox
%input.custom-control-input{ id: id, type: 'checkbox', name: name, value: value, required: required } %input.custom-control-input{ **checkbox_attributes }
%label.custom-control-label{ for: id, aria: { describedby: help_id } }= content %label.custom-control-label{ for: id, aria: { describedby: help_id } }= content
%small.form-text.text-muted{ id: help_id }= yield - if (block = yield).present?
%small.form-text.text-muted{ id: help_id }= block