# How can i set initial directory relative to user home in path\_selector

**URL:** <https://discourse.openondemand.org/t/how-can-i-set-initial-directory-relative-to-user-home-in-path-selector/3720>\
**Category:** Get Help\
**Created:** [August 26, 2024, 3:59pm UTC](https://discourse.openondemand.org/t/how-can-i-set-initial-directory-relative-to-user-home-in-path-selector/3720 "2024-08-26T15:59:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose-d](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jose-d/32/703_2.png) [@jose-d](https://discourse.openondemand.org/u/jose-d)\
**Post date:** [August 26, 2024, 3:59pm UTC](https://discourse.openondemand.org/t/how-can-i-set-initial-directory-relative-to-user-home-in-path-selector/3720/1 "2024-08-26T15:59:09Z")

</div>

usecase: I expect users to have directory “.venvs” in their home.  
How can I point `path_selector` to start there?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [August 26, 2024, 4:14pm UTC](https://discourse.openondemand.org/t/how-can-i-set-initial-directory-relative-to-user-home-in-path-selector/3720/2 "2024-08-26T16:14:01Z")

</div>

You’d set `show_hidden: true` and set the `directory` to the current users directory.

[https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/form-widgets.html?highlight=path\_selector](https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/form-widgets.html?highlight=path_selector)

Something like this with ERB - I’m not sure if `~` would work, but seems like it should if it doesn’t.

```yaml
path:
  widget: path_selector
  show_hidden: true
  direcctory: "<%= CurrentUser.home %>"

```

---

<div class="post-metadata">

**Author:** ![jose-d](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jose-d/32/703_2.png) [@jose-d](https://discourse.openondemand.org/u/jose-d)\
**Post date:** [September 11, 2024, 3:30pm UTC](https://discourse.openondemand.org/t/how-can-i-set-initial-directory-relative-to-user-home-in-path-selector/3720/3 "2024-09-11T15:30:25Z")

</div>

not working for me…

 ![Screenshot_20240911_172923](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/a/a850d9ffbd1ae65825ddda84df1fb18471c08f0f.png)

I do not strictly need path selector, the goal is to offer existing virtual environments to my $user…

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [September 11, 2024, 3:55pm UTC](https://discourse.openondemand.org/t/how-can-i-set-initial-directory-relative-to-user-home-in-path-selector/3720/4 "2024-09-11T15:55:02Z")

</div>

You need to rename the file from `form.yml` to `form.yml.erb` so that it’ll template the file.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [March 10, 2025, 3:55pm UTC](https://discourse.openondemand.org/t/how-can-i-set-initial-directory-relative-to-user-home-in-path-selector/3720/5 "2025-03-10T15:55:45Z")

</div>

Closed on March 10, 2025, 3:55pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
