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

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -