Reputation: 297
I got these 2 boolean functions:
def settled?
self.settled == true
end
def negative_pl?
self.profitloss < 0
end
How can I test for both of them at the same time? I want to do something like this in my view:
<%= 'classRed' if bet.settled?.negative_pl? %>
I know the above don't work, but the best way to explain what I want to do :)
Thanks!
Upvotes: 0
Views: 163
Reputation: 62648
You need a clause per check:
if bet.settled? and bet.negative_pl?
Upvotes: 1