# How are people generating/creating engines within plugins?

**URL:** https://meta.discourse.org/t/how-are-people-generating-creating-engines-within-plugins/52253
**Category:** Development
**Created:** [2016 年10 月 31 日 06:48 UTC](https://meta.discourse.org/t/how-are-people-generating-creating-engines-within-plugins/52253 "2016-10-31T06:48:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JimmyX](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimmyx/32/52302_2.png) [@JimmyX](https://meta.discourse.org/u/JimmyX)
#### Post date: [2016 年10 月 31 日 06:48 UTC](https://meta.discourse.org/t/how-are-people-generating-creating-engines-within-plugins/52253/1 "2016-10-31T06:48:26Z")

</div>

Where plugins use engines are these created in the regular rails way using something like

`rails plugin new myplugin --mountable` in the discourse root directory?

I have git cloned “discourse-links-category” to see what other people do. Within that plugin I don’t find config/routes.rb. Instead it seems to do the same job with code in plugin.rb.

Do I simply add this engine code into plugin.rb (adjusted for what I want) ?

I use develop using vagrant.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2016 年11 月 1 日 01:42 UTC](https://meta.discourse.org/t/how-are-people-generating-creating-engines-within-plugins/52253/2 "2016-11-01T01:42:48Z")

</div>

> [@JimmyX](#):
>
> Do I simply add this engine code into plugin.rb (adjusted for what I want) ?

Yes that’s all it takes. I’m not familiar with the discourse-links-category plugin. I have spent some time going through the discourse-solved [GitHub - discourse/discourse-solved: Allow accepted answers on topics · GitHub](https://github.com/discourse/discourse-solved) plugin. There is a lot that can be learned from looking at that code. For something really basic you could take a look at this: [GitHub - scossar/discourse-blog-post: Adds a blog post class to Discourse · GitHub](https://github.com/scossar/discourse-blog-post)

---

<div class="post-metadata">

### Author: ![JimmyX](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimmyx/32/52302_2.png) [@JimmyX](https://meta.discourse.org/u/JimmyX)
#### Post date: [2016 年11 月 1 日 04:45 UTC](https://meta.discourse.org/t/how-are-people-generating-creating-engines-within-plugins/52253/3 "2016-11-01T04:45:01Z")

</div>

Thanks Simon. I appreciate the pointers on which plugins will be most educational.
