I am trying to add a small amount of logic to one of my templates (please do not scold me about errors in the presentation of logic in the presentation), and it is difficult for me to get the correct hamlc syntax.
I iterate over a collection and want to skip elements that exist in another collection
A direct coffee pot will look like this:
for artwork in artworks
unless _.find(cart_items, (ci) ->
ci.id == artwork.product_code
alert 'artwork not in cart'
I'm trying to:
- for artwork in artworks
- unless _.find(cart_items, (ci) -> |
ci.id == artwork.product_code
- alert 'artwork not in cart'
and I get some garbage about:
Block level too deep in line undefined
Any ideas? TIA, Billy
Billy source
share