I am following an ember-rails tutorial. It's using coffeescript and I'm writing in javascript. Essentially I have a form that when I submit text on it it should place the text below.
My controller looks like this:
Emberapp.ApplicationController = Ember.Controller.extend({
entries: [],
actions: {
addEntry: function(){
this.entries.pushObject name: this.get('newEntryName');
this.set('newEntryName', "");
}
}
});
My template looks like this
<div id = "container">
<h1>Emberails</h1>
{{ input value=newEntryName enter='addEntry' }}
<ul>
{{#each entries}}
<li>{{name}}</li>
{{/each}}
</ul>
</div>
When I reload the page I get an error stating that 'name: this.get('newEntryName');' is an Unexpected identifier. I've been checking for the syntax rules online but I'm not sure if it is a coffeescript to javascript error or something else.
ember-cli
for your ember project. This is especially a good idea if you are new to ember. – Lux