Use `present?` for badge check
This commit is contained in:
parent
5fc481f797
commit
ab81fc0c1b
|
@ -24,7 +24,7 @@ module BootstrapHelper
|
|||
"#{content_tag(:i, '', class: "fa fa-#{options[:icon]}")} #{body}"
|
||||
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",
|
||||
("badge-#{options[:badge_color]}" unless options[:badge_color].nil?),
|
||||
|
|
Loading…
Reference in New Issue