I have a collection of projects and the Meteor.users collection. My goal is to add the document _id of a project to a username.
HTML:
<template name="insertName">
{{#each projectList}}
{{> projectView}}
{{/each}}
</template>
<template name="projectView">
{{#autoForm collection="Meteor.users" id="insertUser" type="insert"}}
{{> afQuickField name="username"}}
// From here I can access the _id property from the projects collection
// Question: How do I pass it to my form without creating an input field?
{{/autoForm}}
</template>
JS:
Meteor.users = new Meteor.Collection('projects');
Meteor.users.attachSchema(new SimpleSchema({
username: {
type: String,
max: 50
},
projectId: {
type: String,
max: 20
// Use autoValue to retrieve _id from projects collection?
}
});
Using the HTML code above, I know I could write this:
{{> afQuickField name='projectId' value=this._id}}
This, however, creates an input field, which I don't want. How can I pass the _id to my autoForm without having a visible input field? Or maybe someone can point me into a different direction?