0
votes

I would like to edit users. I am following this tutorial: http://coding.smashingmagazine.com/2013/11/07/an-in-depth-introduction-to-ember-js/

I have a button in user.hbs to edit the user:

<button {{action "edit"}}>Edit</button> and below it is an {{outlet}}

When click it I'm directed to /index.html#/users/4/edit but my user.edit.hbs template does not show up

Here's userEditRoute.js:

App.UserEditRoute = Ember.Route.extend({
  model: function(){ 
    return this.modelFor('user');
  }
});

And the userController.js:

App.UserController = Ember.ObjectController.extend({
  actions: {
    edit: function(){
      this.transitionToRoute('user.edit');
    }
});

Why won't the user.edit.hbs display?

2
Are you using some build tool like: ember app kit, ember tools etc? - Marcio Junior

2 Answers

0
votes

I don't know how you configured your router, but a url with /users/<someid>/edit expect this.transitionToRoute('user.edit', someObjectOrId);

0
votes

We can do it in the following way. Kindly check this BIN