mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 15:46:21 +00:00
10 lines
463 B
Text
10 lines
463 B
Text
:ruby
|
|
help_id = "#{id}_help"
|
|
checkbox_attributes = local_assigns.slice(:id, :type, :name, :value, :required, :checked, :data)
|
|
checkbox_attributes[:type] ||= 'checkbox'
|
|
|
|
.custom-control{ class: "custom-#{checkbox_attributes[:type]}" }
|
|
%input.custom-control-input{ **checkbox_attributes }
|
|
%label.custom-control-label{ for: id, aria: { describedby: help_id } }= content
|
|
- if (block = yield).present?
|
|
%small.form-text.text-muted{ id: help_id }= block
|