Module: PgqWeb::PgqHelper
- Defined in:
- app/helpers/pgq_web/pgq_helper.rb
Instance Method Summary collapse
Instance Method Details
#class_menu(act) ⇒ Object
3 4 5 |
# File 'app/helpers/pgq_web/pgq_helper.rb', line 3 def (act) act == params[:action] ? 'active' : '' end |
#human_time(str_time) ⇒ Object
18 19 20 |
# File 'app/helpers/pgq_web/pgq_helper.rb', line 18 def human_time(str_time) Time.parse(str_time).strftime("%d.%m.%Y %H:%M:%S") rescue '-' end |
#status_span(status = :ok) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/helpers/pgq_web/pgq_helper.rb', line 7 def status_span(status = :ok) case status when :ok then content_tag(:span, 'ok', :class => "label label-success") when :warn then content_tag(:span, 'warn', :class => "label label-warning") when :error then content_tag(:span, 'error', :class => "label label-important") when :stopped then content_tag(:span, 'stopped', :class => "label") else content_tag(:span, 'ok', :class => "label label-success") end end |