-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save artist and redirect to artist page on save
- Loading branch information
1 parent
bebd89a
commit ee7bf80
Showing
2 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Route.extend({ | ||
model: function () { | ||
return this.modelFor('artist'); | ||
}, | ||
actions: { | ||
save: function () { | ||
var artist = this.model(); | ||
artist.save(); | ||
this.transitionTo('artist', artist); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<div class="page-header"> | ||
<h1>{{name}}<small>Edit</small></h1> | ||
<h1>{{name}} <small>Edit</small></h1> | ||
</div> | ||
|
||
<form role="form"> | ||
<form {{action 'save' on='submit'}} role="form"> | ||
<div class="form-group"> | ||
<label for="name">Artist Name</label> | ||
{{input value=name class='form-control' id='name'}} | ||
</div> | ||
{{#each link in links}} | ||
{{view 'hyperlink' contentBinding='link'}} | ||
{{/each}} | ||
<button type="submit" class="btn btn-default">Submit</button> | ||
<button type="submit" class="btn btn-default">Save Artist</button> | ||
</form> |