0
votes

I am beginner in ember js. I was going through a tutorial for building a simple crud application. Here is how my router.js looks like

export default Router.map(function() { 
  this.resource('users', function(){
    this.resource('user', { path:'/:user_id' }, function(){
        this.route('edit');
    });
    this.route('create');
  });
});

I wanted to reuse edit template in create template so I have implemented render Template in create route. but that hook is not getting called. my project's code can be found on git hub at https://github.com/upadhyayap/my-app.git Nothing is happening if I click on Add user link. Add user link in users page has been created through link To helper and I have given route path as users.create and I am using ember CLI.

1
This was a folder structure issue which Ember resolver was not able to identify.Anand
You mean you didn't follow the naming conventions ?Patsy Issa

1 Answers

0
votes

You can reuse template from one route in another just by using tenplateName property in your route. I had exactly same use case (same template for edit and create) and defining templateName in Route worked well.