# איך להוסיף מסלול לנתיב השורש

**URL:** <https://meta.discourse.org/t/how-to-add-route-to-root-path/186141>\
**Category:** Development\
**Created:** [8 באפריל,‏ 2021,‏ 8:51pm UTC](https://meta.discourse.org/t/how-to-add-route-to-root-path/186141 "2021-04-08T20:51:31Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [8 באפריל,‏ 2021,‏ 10:42pm UTC](https://meta.discourse.org/t/how-to-add-route-to-root-path/186141/4 "2021-04-08T22:42:58Z")

</div>

The other way to do it is like this:

> [@pfaffman](#):
>
> ```plaintext
> Discourse::Application.routes.prepend do
> get "/ssh-key/:hostname" => "pfaffmanager/serverkeys#get_pub_key_by_hostname", constraints: { hostname: /[^\/]+/ }
> end
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-route-to-root-path/186141)._
