Feature: Create a project
Let's add a project form for our feature Create a project
. It consists of a large Add project button, a text box for our project name, and save
and cancel
buttons. Clicking on save will POST the project to our Express server, whereas, clicking on cancel closes the form.
What follows is an HTML template ./templates/project-form.hbs
for a repository item:
<form class="form-inline"> <ul class="errors help"></ul> <label>name</label> <input class="name" placeholder="project name" required="required" value="{{name}}" autofocus /> <br/><button class="cancel btn btn-mini btn-primary form-btn">cancel</button> <button class="save btn btn-mini btn-primary form-btn form-spacer">save</button> </form>
Let's make a few changes to router
and wire up a route to our Add Project
button. routes
now includes a route called add
, which calls a method called add
. We include an add
method that calls projectListView...