Reputation: 16734
I tried the following && conditional for my if statement and I get a "bad range" error:
<% if (from_today(contact, call.days) == 0..7) && (show_status(contact, call) == 'no status') %>
Why and how can I fix it? The only other way I could do it was to have a second nested if statement and break it apart...not pretty :(
Upvotes: 9
Views: 32117
Reputation: 50690
<% if (from_today(contact, call.days) == (0..7) && show_status(contact, call) == 'no status') %>
Upvotes: 12
Reputation: 19485
Try putting the 0..7
in parentheses. The &&
is not your problem here.
Upvotes: 3