Skip to content

Instantly share code, notes, and snippets.

@gabrielhpugliese
Created September 17, 2012 01:16
Show Gist options
  • Save gabrielhpugliese/3735085 to your computer and use it in GitHub Desktop.
Save gabrielhpugliese/3735085 to your computer and use it in GitHub Desktop.
Meteor method is not working
Nomes = new Meteor.Collection("nomes");
Nome = {
remove : function(nome) {
return Nomes.remove({
nome : nome
});
},
get : function(nome) {
return Nomes.findOne({
nome : nome
});
},
set : function(nome) {
return Nomes.insert({
nome : nome
});
}
};
if (Meteor.is_client) {
jQuery(window).unload(function() {
Meteor.call('sair', Session.get('nome'));
console.log('bla');
});
}
if (Meteor.is_server) {
Meteor.methods({
sair : function(nome) {
return Nome.remove(nome);
this.unblock();
}
});
}
@gabrielhpugliese
Copy link
Author

Console.log runs and bla appears in the console...anyone knows how to make this work ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment