syntax - How do I make a haml-coffee closure which spans multiple lines? -
i trying add small amount of logic 1 of templates (please don't scold me on faults of putting logic in view) , having hard time getting correct hamlc syntax.
i iterating on collection , want skip elements exist in collection
the straight coffeescript like:
for artwork in artworks unless _.find(cart_items, (ci) -> ci.id == artwork.product_code alert 'artwork not in cart' i'm trying:
- artwork in artworks - unless _.find(cart_items, (ci) -> | # < multiline, right? ci.id == artwork.product_code - alert 'artwork not in cart' and getting hogwash about:
block level deep in line undefined any ideas? tia, billy
i able work putting closure on same line:
- artwork in artworks - unless _.find(cart_items, (ci) -> ci.id == artwork.id) - alert 'not in cart'
Comments
Post a Comment