mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 14:56:22 +00:00
feat: poder modificar atributos del custom-input
This commit is contained in:
parent
5f5026bcca
commit
c75deaf030
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,9 @@
|
|||
- help_id = "#{id}_help"
|
||||
- checkbox_attributes = local_assigns.slice(:id, :type, :name, :value, :required, :checked)
|
||||
- checkbox_attributes[:type] ||= '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
|
||||
%small.form-text.text-muted{ id: help_id }= yield
|
||||
- if (block = yield).present?
|
||||
%small.form-text.text-muted{ id: help_id }= block
|
||||
|
|
Loading…
Reference in a new issue