Hi Everyone,
I have the following if statement in my view:
<% if @kase.jobno[1,2].to_i == 10 then %>
<img src="../images/2010.jpg" alt="2010">
<% elsif @kase.jobno[1,2].to_i == 11 then %>
<img src="../images/2011.jpg" alt="2011">
<% else %>
<img src="../images/document.jpg" alt="Document" />
<% end %>
It works absolutely perfectly, however, if I want to extend the range of the statement to show a particular image if the @kase.jobno field includes the number 08 and the change the statement to the following:
<% if @kase.jobno[1,2].to_i == 09 then %>
<img src="../images/20109.jpg" alt="2009">
<% elsif @kase.jobno[1,2].to_i == 10 then %>
<img src="../images/2010.jpg" alt="2010">
<% elsif @kase.jobno[1,2].to_i == 11 then %>
<img src="../images/2011.jpg" alt="2011">
<% else %>
<img src="../images/document.jpg" alt="Document" />
<% end %>
then I get the following error:
Illegal octal digit
which points to the 09 value.
Is it impossible to have an if statement which compares against an 0X (number starting with zero and followed by other digit) number?
Thanks,
Danny