So i’m a ror beginner and I’m trying to do this:
I have ratings out of 100
I’d like to do
if rating is between 66 and 100, background colour is green
if rating is between 33 and 66, background colour is orange
if rating is between 00 and 33, background colour is red
also my ratings are the average of other ratings so the number aren’t actually in the DB, they’re just the result of this:
<%= number_with_precision(show.reviews.average("rating"), :precision => 0)
any tutorials around that might explain how to do this ?
You can use
between?method.