Tim*_* T. 9 if-statement boolean ruby-on-rails
我尝试了以下&&条件为我的if语句,我得到一个"坏范围"错误:
<% if (from_today(contact, call.days) == 0..7) && (show_status(contact, call) == 'no status') %>
Run Code Online (Sandbox Code Playgroud)
为什么以及如何解决它?我能做到的唯一另一种方法是使用第二个嵌套的if语句并将其分开...不漂亮:(
Dol*_*lph 12
<% if (from_today(contact, call.days) == (0..7) && show_status(contact, call) == 'no status') %>
Run Code Online (Sandbox Code Playgroud)