Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 have a second nested if statement and break it apart...not pretty :(

like image 475
Satchel Avatar asked May 29 '10 16:05

Satchel


People also ask

What is CanIUse com?

With a simple search of a property, parameter, or feature, caniuse.com will tell you precisely what browsers and versions support that technology. CanIUse also lets you know variants of the property that you're looking for. That way you know which kinds of media queries, for instance, are supported by which browsers.

Has CSS selector can I use?

Presently, the CSS :has() selector is not widely supported by browsers; this selector only works in the latest version of Safari or via the experimental features flag in the latest version of Chrome. So for now, we must not use :has() in production.

Can I use focus visible?

Update – November 2021. The :focus-visible pseudo-class is now supported in all major browsers apart from Safari.


1 Answers

<% if (from_today(contact, call.days) == (0..7) && show_status(contact, call) == 'no status') %>
like image 148
Dolph Avatar answered Oct 16 '22 09:10

Dolph