From c75deaf030f11bcae796e5110bc649a3869766cb Mon Sep 17 00:00:00 2001 From: f Date: Fri, 17 May 2024 14:59:23 -0300 Subject: [PATCH] feat: poder modificar atributos del custom-input --- app/views/bootstrap/_custom_checkbox.haml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/bootstrap/_custom_checkbox.haml b/app/views/bootstrap/_custom_checkbox.haml index 0c3ff3a6..a2cf6c27 100644 --- a/app/views/bootstrap/_custom_checkbox.haml +++ b/app/views/bootstrap/_custom_checkbox.haml @@ -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