I'm trying to learn Meteor and coffeescript, but I'm stuck while trying to learn meteor methods calls. I wrote the following code:
client/views/home/home.html
<template name="home">
Welcome to my new meteor app
<input type="button" id='createFile' value="createFile" />
</template>
client/views/home/home.coffee
Template.home.events
'click #createFile': ->
Meteor.call 'alwaystrue', (error, result) ->
console.log error
console.log result
return
console.log 'You pressed the button' if typeof console isnt 'undefined'
return
server/metodi.coffee
Meteor.methods
alwaystrue: ->
true
The button when clicked should call a server method from the client, using Meteor.call , but it says that the alwaystrue method is not found.
What am I doing wrong? why my code cant see the methods?
I'm starting from this boilerplate: https://github.com/Differential/meteor-boilerplate , whit the latest node.js/meteor, on the latest ubuntu (14.04).
.coffeeand isn't being compiled, the method name is misspelled, etc. - David Weldon