# Adding Dynamic Routes in a Plugin

**URL:** <https://meta.discourse.org/t/adding-dynamic-routes-in-a-plugin/93200>\
**Category:** Development\
**Created:** [7월 26, 2018, 12:19오후 UTC](https://meta.discourse.org/t/adding-dynamic-routes-in-a-plugin/93200 "2018-07-26T12:19:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tjaco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tjaco/32/119723_2.png) [@tjaco](https://meta.discourse.org/u/tjaco)\
**Post date:** [7월 26, 2018, 12:19오후 UTC](https://meta.discourse.org/t/adding-dynamic-routes-in-a-plugin/93200/1 "2018-07-26T12:19:29Z")

</div>

Hi Everyone,

to start of, I am pretty new at Ember and Discourse so excuse anything I ask that should be self explanatory… 🙂

I am creating a plugin for a client and need to define some dynamic routes. I have done this in plane ember within 15 minutes, but can’t seem to get this to work in discourse.

Basically I need a routing structure like this:

Basically I have posts and need to define a show view per post.

Have these routes setup in plain Ember:

```plaintext
this.route('posts');
this.route('posts.show', { path: 'posts/:post_id' }

```

I have a controller setup that just returns some json, so the actual post\_id wouldn’t matter.

Basically I understand that once you have a dynamic route, you should define a specific route that returns a model, which you can then use in the template.  
Currently it is not working and returns a undefined property ‘post’ for undefined. So I’m guessing I need to do something more in discourse to get this to work.

Can someone point me in the right direction and/or point me to some documentation where I can get this information?

Thanks!

Tjaco

---

_[View the full topic](https://meta.discourse.org/t/adding-dynamic-routes-in-a-plugin/93200)._
