I am trying to build in color-coding in my site for a particular class method, such that some values display in a different color if they are low.
I just defined a class method that translates numbers stored in my database to words that are displayed to my users.
# model.rb
def numbers_explained
numbers_explained = case number
when 0 then "Low"
when 1 then "OK"
when 2 then "OK"
when 3 then "High"
end
end
The other thing I'd like to do is always display "Low" in red.
Can we 'scope' CSS styles like we do with data? Could I attach something like color:red !important;
?