Topic: Show image if number < 30 else show altternate image
I am trying to write a method that will show an image if the number of days is greater than 30 else show a different image.
I have:
def num_of_days
num_of_days = (dor - transfer)/96400.to_i
end
def show_flag
if num_of_days > 30.0
puts "green"
else
puts "red"
end
end
being I do not yet know how to put the image in I tried to display the words green and red for the time being. Then in my veiw I did this:
<p>
<%= @hrreview.show_flag %>
</p>
but nothing shows at all, and but num_of_days does calculate and show the number of days.... so I am confused what I am doing wrong.