I’ve build a todo-list with a Rails-API.
I’ve followed a tutorial, even if it was deprecated, by following the guides and others resources, I’ve succeed most steps.
However, since yesterday, I can’t understand what’s wrong in my code :
app/templates/application.hbs
<h1> ToDo App </h1>
{{input type="text" id="new-todo" value=newTitle placeholder="what's need to be done?" action="createTodo"}}
I’ve understand the onKeydownHandler however I dont understand the input.
Should it looks like something like this {{input type="text" id="new-todo" value=newTitle placeholder="smth" focusOut=(action "createTodo") keyDown=(action "onKeydownHandler")}} ?
You should still use <form> tags and put the submit action there. That’ll take care of hitting [Enter] but the leaving focus would need a different solution.