Q:

how can I disable a checkbox in a mustache view if a condition is met?

this is part of the json response
"name_with_grade": "2º - A",
"rates": [
{
  "name": "Evaluación",
  "quantity": 1,
  "due_date": null,
  "optional": false,
  "rate": 300
},

and the mustache
      {{#rates}}
        {{#rate}}
          <tr>
            <td><input type="checkbox"></td>
            <td>{{name}}</td>
            <td>{{rate}}</td>
          </tr>
        {{/rate}}
      {{/rates}}

rate could be blank hence the {{#rate}} but some are optional and i would like to disable the checkbox for those that aren't.

A:

Changed the logic to be required instead of optional and this seems to do it, some better ideas welcome.
<td>
  <input type="checkbox"
    {{#required}}
      disabled="disabled" checked="checked"
    {{/required}}>
</td>

