tonyf
March 20, 2016, 2:46pm
1
Hi,
Hoping someone can assist, but I am currently issues using Meteor.call and Meteor.methods, which seems to be quite straight forward in a synchronous manner.
Unfortunately I am receiving the following error message:
Error invoking Method 'addEditingUser': Method not found [404]
My code is as follows:
On Client:
editor.on("change", function(cm_editor, info){
$("#viewer_iframe").contents().find("html").html(cm_editor.getValue());
Meteor.call("addEditingUser");
});
Meteor.methods({
addEditingUser: function(){
EditingUsers.insert({user:"tonyf"});
}
});
Any ideas pls?
Thanks.
tonyf
March 21, 2016, 7:07am
3
Will try it out but also found this thread as well.
tonyf
March 21, 2016, 9:01am
4
Just continuing on from the thread I posted in my previous post, I made the following changes to my code, i.e.
I created two new directories within my root application folder:
Within the lib directory, I moved all my Mongo collection creation into a new collections.js file, i.e.:
EditingUsers = new Mongo.Collection("editingUsers")
;
and within the server directory, I moved the following code into a new startup.js file, i.e.:
`Meteor.methods({
addEditingUser: function(){
return EditingUsers.insert({user:"tonyf"});
}
});
`
All good now.
Thanks for your help.
Can someone now pls let me know how to mark this thread as “SOLVED ” ?
You should see a small pencil icon beside the title that let’s you adjust the title contents. I’ve gone ahead and done this for you.
tonyf
March 21, 2016, 1:54pm
6
Got it - thanks @hwillson