0
votes

I have the following template:

<template name="editUser">
    {{> quickForm collection="Users" doc=doc id="editUserForm" type="update"}}
</template>

And I render it in a popover div using:

  Blaze.renderWithData(Template.editUser, data, target);

I would like to pass the doc variable required by the quickform and don't really understand the data parameter.

I tried to use the following as data:

var data = {doc: Users.find({_id: feature.getId()}).fetch()};

but this does not seem to be the way to pass a document in the variable doc.

i could not find how to properly use it and would like to avoid a session variable.

1

1 Answers

0
votes

I just realized that I need to pass the cursor and not the data itself. So it works when I replace:

var data = {doc: Users.find({_id: feature.getId()}).fetch()};

with

var data = {doc: Users.find({_id: feature.getId()})};