Module: ChecksHelper

Defined in:
app/helpers/checks_helper.rb

Instance Method Summary collapse

Instance Method Details

#class_for_active(active) ⇒ Object


14
15
16
# File 'app/helpers/checks_helper.rb', line 14

def class_for_active(active)
  active ? "text-green" : "text-red"
end

#class_for_active_checkbox(active) ⇒ Object


17
18
19
# File 'app/helpers/checks_helper.rb', line 17

def class_for_active_checkbox(active)
  active ? "fe-check" : "fe-minus"
end

#class_for_healthy(percent) ⇒ Object


20
21
22
# File 'app/helpers/checks_helper.rb', line 20

def class_for_healthy(percent)
  percent == 100.0 ? "text-green" : "text-red"
end

#class_for_status(status) ⇒ Object


2
3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/checks_helper.rb', line 2

def class_for_status(status)
  case status.to_i
  when 200..299
    "success"
  when 300..399
    "info"
  when 400..499
    "warning"
  else
    "danger"
  end
end