# Simple example for plugin to change files?

**URL:** <https://meta.discourse.org/t/simple-example-for-plugin-to-change-files/270206>\
**Category:** Development\
**Created:** [June 30, 2023, 9:40pm UTC](https://meta.discourse.org/t/simple-example-for-plugin-to-change-files/270206 "2023-06-30T21:40:07Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)\
**Post date:** [June 30, 2023, 9:40pm UTC](https://meta.discourse.org/t/simple-example-for-plugin-to-change-files/270206/1 "2023-06-30T21:40:08Z")

</div>

I’m trying to write my first very basic plugins on Discourse, after read a lot about Ruby and the benefits the language offers to us 🙂

I want to add text to specific pages like badges, leaderboard (gamification) and similar simple edits like changing the default behavior on search order results, last posts instead relevance.

I understand the best approach is avoid forking the core and write plugins. So where can I look if I want to change specific files on Discourse from a plugin?

We can take an example editing this file:

> <https://github.com/discourse/discourse/blob/5584fb1e3b7a29d7ee5d7e43520191081dd10a16/app/models/topic_embed.rb#L38>

_How to tell Discourse to use the plugin `topic_embed.rb` and replace default one?_

---

_[View the full topic](https://meta.discourse.org/t/simple-example-for-plugin-to-change-files/270206)._
