Module: RailsErrorDashboard::ApplicationHelper

Defined in:
app/helpers/rails_error_dashboard/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#severity_color(severity) ⇒ String

Returns Bootstrap color class for error severity

Parameters:

  • severity (Symbol)

    The severity level (:critical, :high, :medium, :low, :info)

Returns:

  • (String)

    Bootstrap color class (danger, warning, info, secondary)



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/rails_error_dashboard/application_helper.rb', line 6

def severity_color(severity)
  case severity&.to_sym
  when :critical
    "danger"
  when :high
    "warning"
  when :medium
    "info"
  when :low
    "secondary"
  else
    "secondary"
  end
end