# Added custom initializer

**URL:** https://meta.discourse.org/t/added-custom-initializer/42722
**Category:** Development
**Created:** [April 18, 2016, 11:00am UTC](https://meta.discourse.org/t/added-custom-initializer/42722 "2016-04-18T11:00:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jamesarobbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesarobbo/32/121843_2.png) [@jamesarobbo](https://meta.discourse.org/u/jamesarobbo)
#### Post date: [April 18, 2016, 11:00am UTC](https://meta.discourse.org/t/added-custom-initializer/42722/1 "2016-04-18T11:00:17Z")

</div>

Just to be certain, I’ve added a custom initializer file to the initializers folder, will this be picked up when the app starts?

Cheers

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [April 18, 2016, 12:18pm UTC](https://meta.discourse.org/t/added-custom-initializer/42722/2 "2016-04-18T12:18:36Z")

</div>

Have a look at

> [@Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins/30515):
>
> Building a plugin in Discourse can be really simple, once you learn a couple of quirks. The goal of this post is to create a skeleton plugin and introduce you to the basics. Your development environment Make sure you have a development environment of Discourse running on your computer. I recommend you use [the appropriate setup guide](https://meta.discourse.org/tag/dev-install) and come back when you’re done. plugin.rbtada Use [GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins · GitHub](https://github.com/discourse/discourse-plugin-skeleton) to create a complete di…

---

<div class="post-metadata">

### Author: ![jamesarobbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesarobbo/32/121843_2.png) [@jamesarobbo](https://meta.discourse.org/u/jamesarobbo)
#### Post date: [April 18, 2016, 10:15pm UTC](https://meta.discourse.org/t/added-custom-initializer/42722/3 "2016-04-18T22:15:16Z")

</div>

thanks, i’ve already created the plugin per the guide but it’s not clear where the initializer file should go?

somewhere like this…

plugins/my-plugin/config/initializers/initializer.rb

or would the code just simply go in an after\_initialize block in the plugin.rb file?

**Basically, i create a site\_setting with the plugin and then straight away i need to be able to use that setting**

much appreciated

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [April 19, 2016, 3:08pm UTC](https://meta.discourse.org/t/added-custom-initializer/42722/5 "2016-04-19T15:08:52Z")

</div>

I suggest you look at the source code of one of our plugins such as [discourse-tagging](https://github.com/discourse/discourse-tagging) for further examples if it’s not clear from the guides.

Adding a site setting is covered in [part 3](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-3-custom-settings/31115) and no initializer is required.
