I would like to perform this simple test :
If a variable contains the string “abc” or “cba” perform task1, else perform task b Here is what I tried, which does not work :
<% if animal == "Meuh" || "Moooo" %>
This is a cow !
<% else %>
This is not a cow !
<% end %>
But This is not working.
Any hints please ?
ERB uses the same syntax as Ruby (and most languages):
Alternatively (especially with lots of alternatives) you can use
Array#include?: