When using a autoform to update a collection like so:
{{> quickForm collection="MediaCollection" doc=updateMediasingle id="updateMediaForm" type="update"}}
And defining a doc in a template helper:
Template.editmedia.helpers({
updateMediasingle: function() {
return MediaCollection.findOne({_id: $stateParams.mediaID});
}
});
I'm getting:
Exception in template helper: TypeError: collection.findOne is not a function
at Object.Template.afFileUpload.helpers.fileUpload /yogiben_autoform-file.js?:285:24)
It fails to load the image on first render but does load it after I hit submit on the update form..
When using a autoform to update a collection like so: {{> quickForm collection="MediaCollection" doc=updateMediasingle id="updateMediaForm" type="update"}}
And defining a doc in a template helper: Template.editmedia.helpers({ updateMediasingle: function() { return MediaCollection.findOne({_id: $stateParams.mediaID}); } }); I'm getting: Exception in template helper: TypeError: collection.findOne is not a function at Object.Template.afFileUpload.helpers.fileUpload /yogiben_autoform-file.js?:285:24)
It fails to load the image on first render but does load it after I hit submit on the update form..