title: Conditional partials in Handlebars
body: <p>I have the following data that I am trying to feed into a Handlebar template</p>
  
  <pre><code>{
      "set-group": [
          {
              "label": "Source Data",
              "type": "select",
              "options": [
                  {
                      "value": "Default Selections"
                  },
                  {
                      "value": "Other Selections"
                  }
              ]
          },
          {
              "label": "Scale",
              "type": "radio",
              "options": [
                  {
                      "value": "log",
                      "label": "Log",
                      "groupname": "group2"
                  },
                  {
                      "value": "linear",
                      "label": "Linear",
                      "groupname": "group2"
                  }
              ]
          }
      ]
  }
  </code></pre>
  
  <p>I created and registered 2 Partials, one that templates "selects" form elements and one that templates "radio" inputs. I cannot know what type of form element will be in the data so I need some sort of helper that checks if type == select and applies the appropriate partial for the select. I am having trouble with creating such a helper.</p>
  
  <p>I was thinking of replacing type=select in the data to just select=true and just check for true/false using the if/else helper but I would rather keep the format standardized</p>
  
  <p>Any ideas?</p>