From 364786e7cb84977d4b88fd35b54b3b724b7c091f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaz=C4=B1m=20Aydin?= Date: Fri, 11 Oct 2024 14:59:56 +0300 Subject: [PATCH] Fix: Add missing form-control-color class for color_field --- lib/bootstrap_form/inputs/base.rb | 1 + test/bootstrap_fields_test.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bootstrap_form/inputs/base.rb b/lib/bootstrap_form/inputs/base.rb index f0513c97..94833bd9 100644 --- a/lib/bootstrap_form/inputs/base.rb +++ b/lib/bootstrap_form/inputs/base.rb @@ -10,6 +10,7 @@ def bootstrap_field(field_name) define_method :"#{field_name}_with_bootstrap" do |name, options={}| warn_deprecated_layout_value(options) options = options.reverse_merge(control_class: "form-range") if field_name == :range_field + options = options.reverse_merge(control_class: "form-control form-control-color") if field_name == :color_field form_group_builder(name, options) do prepend_and_append_input(name, options) do options[:placeholder] ||= name if options[:floating] diff --git a/test/bootstrap_fields_test.rb b/test/bootstrap_fields_test.rb index bf3a5d2f..aa88aad4 100644 --- a/test/bootstrap_fields_test.rb +++ b/test/bootstrap_fields_test.rb @@ -9,7 +9,7 @@ class BootstrapFieldsTest < ActionView::TestCase expected = <<~HTML
- +
HTML assert_equivalent_html expected, @builder.color_field(:misc)