#each with call to helper ignores first entry in array

May 14, 2013 in answer

0 votes, 0.00 avg. rating (0% score)

ANSWER:

Really going out on a whim here but my traditional approach would be below. I don’t know whether it will work but it was too big for a comment, yet again it’s not a guaranteed fix. Let me know how it goes:

Replace the HTML with

#each modules}
  • linkName}
  • /each}

    Replace the CS with

    Template.moduleHeader.isActive = () ->
        currentModule = this
        currentModuleName = currentModule.moduleName
        if currentModuleName is Session.get 'module'
            "class=active"
    

    rickyduck from http://stackoverflow.com/questions/16538018