I might be approaching this all wrong (i'm fairly new to Ruby), but can someone tell me how to check for certain values in an Object?
I want to check if any of the taxons in product.taxons contains any of 'rush_delivery' or 'customization_possible' in their machine_names.
My template code:
<div class="expanded">
<% product.taxons.each do |t| %>
<% if t.machine_name == 'rush_delivery' %>
<p class="icon icon-urgent">
<span class="tooltip"><%= Spree.t('usp.rush_delivery') %></span>
</p>
<% end %>
<% if t.machine_name == 'customization_possible' %>
<p class="icon icon-customize">
<span class="tooltip"><%= Spree.t('usp.customization_possible') %></span>
</p>
<% end %>
<% end %>
</div>
The goal is to add a hide class on the parent div if they do not exist.