Module: Peephole::ApplicationHelper

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

Instance Method Summary collapse

Instance Method Details

#status_label(status) ⇒ Object



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

def status_label(status)
  label = case status
          when /\A2/
            'success'
          when /\A3/
            'info'
          else
            'danger'
          end
  (:span, status, class: "label label-#{label}")
end