AutoForm "options" not working when tying to a helper

I’m starting off with just trying to get a select dropdown of product names, then I’ll worry about checkboxes. But this is failing.

{{#autoForm collection="Leads" id="lead-form" type="method"
meteormethod="insertLead"}}
  [...]
  {{> afQuickField name="interestedIn" options="products"}}

  <button type="submit" class="btn btn-primary btn-lg">Submit</button>
{{/autoForm}}
Leads = new Mongo.Collection('leads');

Leads.attachSchema(new SimpleSchema({
  interestedIn: {
    type: String,
    label: 'Which products are you interested in?'
  },
[...]
Template.myTemplate.helpers({
  products: function () {
    return Products.find().map(function (p) {
      return {label: p.name, value: p._id};
    });
  }
});

I’m getting these errors:

Exception in template helper: TypeError: Cannot read property 'toString' of undefined
    at http://localhost:3000/packages/aldeed_autoform.js?e71f561d26e90711b8a4ddf6136073fdffff296d:5351:25

Exception in template helper: TypeError: Cannot read property 'class' of undefined
    at Object.addClass (http://localhost:3000/packages/aldeed_autoform.js?e71f561d26e90711b8a4ddf6136073fdffff296d:624:20)

Ah, got it. Correct syntax is:

{{> afQuickField name="interestedIn" options=products}}
1 Like