# Passing parameters between template hbs pages

**URL:** <https://discuss.emberjs.com/t/passing-parameters-between-template-hbs-pages/13355>\
**Category:** Ember CLI\
**Created:** [July 28, 2017, 10:11am UTC](https://discuss.emberjs.com/t/passing-parameters-between-template-hbs-pages/13355 "2017-07-28T10:11:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gayathri\_Chelladurai](https://avatars.discourse-cdn.com/v4/letter/g/b77776/32.png) [@Gayathri\_Chelladurai](https://discuss.emberjs.com/u/Gayathri_Chelladurai)\
**Post date:** [July 28, 2017, 10:11am UTC](https://discuss.emberjs.com/t/passing-parameters-between-template-hbs-pages/13355/1 "2017-07-28T10:11:20Z")

</div>

app/templates/tasks.hbs: {{outlet}}

# Tasks
{{#each model as |task|}} 

#### {{#link-to 'tasks.edit' task.id}}{{task.title}}{{/link-to}}
Created: {{format-date task.created}}  
Due: {{format-date task.date}}
##### Priority: {{task.priority}}

{{task.description}}

 Delete
* * *

```
	{{#link-to 'subtasks.subnew' task.id}}<button class="btn btn-primary">Create SubTask</button>{{/link-to}}

	{{#link-to 'subtasks' task.id}}<button class="btn btn-primary">Show SubTasks</button>{{/link-to}}
</div>

```

{{/each}}

app/templates/subtasks.hbs: {{outlet}}

# SubTasks
{{#each model as |subtask|}}
# {{model.id}}

###### {{subtask.tno}}
{{#if model.id subtask.tno}} 

#### {{#link-to 'subtasks.subedit' subtask.id}}{{subtask.subtitle}}{{/link-to}}
Created: {{format-date subtask.subcreated}}  
Due: {{format-date subtask.subdate}}
##### Priority: {{subtask.subpriority}}

{{subtask.subdescription}}

 Delete 
{{/if}} {{/each}}

app/routes/tasks.js: import Ember from ‘ember’;

export default Ember.Route.extend({ model(){ return this.store.findAll(‘task’); } });

app/routes/subtasks.js: import Ember from ‘ember’;

export default Ember.Route.extend({ model(){ return this.store.findAll(‘subtask’); } });

Here i couldn’t get the value of task\_id passed from tasks.hbs to subtasks.hbs.what should i do to get task\_id passed from tasks.hbs to subtasks.hbs?

---

<div class="post-metadata">

**Author:** ![martletandco](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/martletandco/32/13089_2.png) [@martletandco](https://discuss.emberjs.com/u/martletandco)\
**Post date:** [July 31, 2017, 12:01am UTC](https://discuss.emberjs.com/t/passing-parameters-between-template-hbs-pages/13355/2 "2017-07-31T00:01:32Z")

</div>

Ember uses the [pattern defined in `router.js` to know which parameters to pass in the `Route.model` method](https://guides.emberjs.com/v2.14.0/routing/specifying-a-routes-model/#toc_dynamic-models). You can then use that parameter to [filter records in your store](https://guides.emberjs.com/v2.14.0/models/finding-records/#toc_querying-for-multiple-records)

It looks like you’re already passing the parameter (`{{#link-to 'subtasks' task.id}}`), you need to get that value from the `params` argument in the `model` method of `app/routes/subtasks.js`
