Use `present?` for badge check

This commit is contained in:
Karina Kwiatek 2023-05-30 22:29:31 +02:00
parent 5fc481f797
commit ab81fc0c1b
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ module BootstrapHelper
"#{content_tag(:i, '', class: "fa fa-#{options[:icon]}")} #{body}" "#{content_tag(:i, '', class: "fa fa-#{options[:icon]}")} #{body}"
end end
end end
if options.has_key?(:badge) || options.dig(:badge_attr, :data)&.has_key?(:controller) if options[:badge].present? || options.dig(:badge_attr, :data)&.has_key?(:controller)
badge_class = [ badge_class = [
"badge", "badge",
("badge-#{options[:badge_color]}" unless options[:badge_color].nil?), ("badge-#{options[:badge_color]}" unless options[:badge_color].nil?),