开发者

How can I use && in if in Ruby on Rails?

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开发者_JS百科 have a second nested if statement and break it apart...not pretty :(


<% if (from_today(contact, call.days) == (0..7) && show_status(contact, call) == 'no status') %>


Try putting the 0..7 in parentheses. The &&is not your problem here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜