title: Check if a value is within a range in Rails 3?
body: <p>I am working on a Rails 3 application and need to display some test results in the following format:</p>
  
  <pre><code>TestLower     TestResult    TestUpper
  1.1           1.5           2.0
  </code></pre>
  
  <p>What I would like to do, is give the result one css class if the value is within the Lower and Upper limit and then give it a different css class if the value falls outside of the range.</p>
  
  <p>I have used if and unless statements before but this is a little more complicated because I need to compare one value against two others, rather than one value against one other.</p>
  
  <p>The only way I can think of doing it would involve quite a few if statements and fallbacks. Such as 'if @lab.TestResult > @lab.TestLower' and then have another one the same that checks it's lower than the TestUpper.</p>
  
  <p>Is there a simple way of doing this? Maybe a rails number helper of some form?</p>
  
  <p>Any help would be appreciated!</p>