app/helpers/application_helper.rb
def format_election_status(status, small=false)
    css_small = small == true ? 'small-status' : ''
    key = 'activerecord.attributes.election.status_types'
    flag = case status
    when I18n.t("#{key}.ongoing")
      'green'
    when I18n.t("#{key}.coming_up")
      'yellow'
    when I18n.t("#{key}.completed")
      'red'
    end
    return "<div class='election-status #{flag} #{css_small}'>#{status}</div>".html_safe
  end
# format election status
# - on going = green
# - coming up = yellow
# - completed = red
format election status
on going = green
coming up = yellow
completed = red
format election status on going = green coming up = yellow completed = red
def format_election_status(status, small=false)
    css_small = small == true ? 'small-status' : ''
    key = 'activerecord.attributes.election.status_types'
    flag = case status
    when I18n.t("#{key}.ongoing")
      'green'
    when I18n.t("#{key}.coming_up")
      'yellow'
    when I18n.t("#{key}.completed")
      'red'
    end
    return "<div class='election-status #{flag} #{css_small}'>#{status}</div>".html_safe
  end
def format_election_status ( status , small = false ) css_small = small == true ? 'small-status' : '' key = 'activerecord.attributes.election.status_types' flag = case status when I18n . t ( "#{key}.ongoing" ) 'green' when I18n . t ( "#{key}.coming_up" ) 'yellow' when I18n . t ( "#{key}.completed" ) 'red' end return "<div class='election-status #{flag} #{css_small}'>#{status}</div>" . html_safe end
format election status
 on going = green
 coming up = yellow
 completed = red
format election status on going = green coming up = yellow completed = red
status
small