# When does the Plugin.rb run?

**URL:** https://meta.discourse.org/t/when-does-the-plugin-rb-run/55046
**Category:** Development
**Created:** [January 2, 2017, 7:08am UTC](https://meta.discourse.org/t/when-does-the-plugin-rb-run/55046 "2017-01-02T07:08:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Alavi1412](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alavi1412/32/67721_2.png) [@Alavi1412](https://meta.discourse.org/u/Alavi1412)
#### Post date: [January 2, 2017, 7:08am UTC](https://meta.discourse.org/t/when-does-the-plugin-rb-run/55046/1 "2017-01-02T07:08:47Z")

</div>

sorry for my question but it is annoying me for long time.  
in plugins I use JS. in javascript we our code run in special event for example when we use outlets we now our code will run when the outlet is shown.  
but for plugin.rb I think this code will run just at the beginning of the app.  
can anyone one help me when else this code will run?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 2, 2017, 8:38am UTC](https://meta.discourse.org/t/when-does-the-plugin-rb-run/55046/2 "2017-01-02T08:38:27Z")

</div>

> [@Alavi1412](#):
>
> but for plugin.rb I think this code will run just at the beginning of the app.

That’s right.

> [@Alavi1412](#):
>
> can anyone one help me when else this code will run?

I suggest you become familiar with Ruby on Rails. Their [guides](http://guides.rubyonrails.org/getting_started.html) are pretty good.
