I have the following router setup:
Router.map(function() {
this.route("login");
this.route("dashboard");
this.route("projects", function() {
this.route("show", {path: "/:project_id"});
this.route('tasks', {path: "/:project_id/tasks" },function() {
this.route('new', {path: "/new"});
this.route('show', {path: "/:task_id"});
});
});
});
And, in templates/projects/show.hbs
, I'd like to render the component for creating a new task ( the component is automatically generated by ember, but I have my own template and controllers at controllers/projects/tasks/new.js
and templates/projects/tasks/new.hbs
). I tried the following:
{{tasks/new model=model}}
But I receive this error:
Assertion Failed: A helper named "tasks/new" could not be found
What is the proper way of fixing this?
{{tasks/new
here task/new
can be a Component or Helper but can't be template hbs.
If you want to include tasks/new
inside templates/projects/show.hbs
then I would encourage you to create component for tasks/new
and include it where ever you require.
You can give it try by mentioning different templateName for template hbs. using templateName
property.
Inside show.js
route file define templateName: 'projects/tasks/new'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With