I have a collection of decks, and each deck has a number of cards. The field "cards" is an array holding the IDs of the cards in the deck.
Problem is, I have a card list from which the user can choose cards to add to a deck. When the user chooses a card to add to the cards array inside Decks collection, Deps throws an exception saying "can't create second landmark in same branch" unless I don't use a partial to render the list, which is an issue for me since each card has its own events. Though the data is added properly to the deck since when I refresh the page, the updates appear.
Decks.js
Template.deckList.deck = () ->
Decks.findOne(_id: Session.get "deck").cards
Deck-list.html
<template name="deckList">
<section class="deck-list"><h1>deck</h1>
<ul class="cards">
{{#each deck}}
{{> cardInList}}
{{/each}}
</ul></section>
</template>
Now I thought of making a separate collection to hold both IDs (card and deck), but that might not work for future collections with the same issues (hand for example in the game collection)
Thanks!