Does @index work within an if?

From: Liam Morley <notifications@github.com<mailto:notifications@github.com>>
Reply-To: projecttacoma/bonnie <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Sunday, December 8, 2013 11:25 PM
To: projecttacoma/bonnie <bonnie@noreply.github.com<mailto:bonnie@noreply.github.com>>
Subject: Re: [bonnie] Patient builder expected values update + bugfixes (#5)


In app/assets/javascripts/templates/patient_builder/expected_value.hbs:

>    <form class="form-inline" role="form">
>      {{#each currentCriteria}}
> -      <div class="checkbox">
> -        <label>
> -          <input type="checkbox" id="{{this}}"> {{this}}
> +      <div class="checkbox {{#if index}}checkbox-divider{{/if}}">


It looks like index is equal to the index of this item in currentCriteria. Handlebars gives you @index, which is available within an each block, which you can use instead.

—
Reply to this email directly or view it on GitHub<https://github.com/projecttacoma/bonnie/pull/5/files#r8188800>.