I create a contact with a route named new (contacts/new). A route named edit (contacts/id/edit) is used to edit the contact. I want to use the same template and controller actions as before and set the new model to the controller's model property. I use render function inside renderTemplate hook in the edit's route to render the template. I use controllerFor inside the setupController hook to set the model to the new route's controller. The controller gets loaded only if the new's route is previously loaded (contract/new). On editing the contact directly using the URL, "contacts/1/edit", the controller is not invoked. What is the solution?
Aucun commentaire:
Enregistrer un commentaire