Skip to content

Commit

Permalink
Save artist and redirect to artist page on save
Browse files Browse the repository at this point in the history
  • Loading branch information
treyhunner committed Nov 4, 2014
1 parent bebd89a commit ee7bf80
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions app/routes/artist/edit.js
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);
},
},
});
6 changes: 3 additions & 3 deletions app/templates/artist/edit.hbs
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>

0 comments on commit ee7bf80

Please sign in to comment.