# Customizing Files app favorites

**URL:** <https://discourse.openondemand.org/t/customizing-files-app-favorites/2208>\
**Category:** Get Help\
**Tags:** ondemand2\
**Created:** [July 29, 2022, 7:23am UTC](https://discourse.openondemand.org/t/customizing-files-app-favorites/2208 "2022-07-29T07:23:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdkruzr](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jdkruzr/32/650_2.png) [@jdkruzr](https://discourse.openondemand.org/u/jdkruzr)\
**Post date:** [July 29, 2022, 7:23am UTC](https://discourse.openondemand.org/t/customizing-files-app-favorites/2208/1 "2022-07-29T07:23:46Z")

</div>

Hi, I’m trying to follow the customization instructions for the Files app found here:  
[https://osc.github.io/ood-documentation/latest/customization.html](https://osc.github.io/ood-documentation/latest/customization.html)

Specifically this:

```auto
OodFilesApp.candidate_favorite_paths.tap do |paths|
  # add project space directories
  projects = User.new.groups.map(&:name).grep(/^P./)
  paths.concat projects.map { |p| FavoritePath.new("/fs/project/#{p}") }

  # add User scratch space directory
  paths << FavoritePath.new("/fs/scratch/#{User.new.name}")

  # Project scratch is given an optional title field
  paths.concat projects.map { |p| FavoritePath.new("/fs/scratch/#{p}", title: "Scratch") }
end

```

So, I don’t understand how this does what it does.

1. What is the “tap” attribute of OodFilesApp.candidate\_favorite\_paths? This is a method? So nothing will happen in this initializer without doing something with method “tap?”
2. I don’t need anything this complicated w/r/t building a dynamic list of favorites every time the user opens the dashboard. It only needs exactly one path (/mnt/data) – in fact, I don’t even want the user’s home. How can this be accomplished?

Thanks!

---

<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:** [July 29, 2022, 1:02pm UTC](https://discourse.openondemand.org/t/customizing-files-app-favorites/2208/2 "2022-07-29T13:02:47Z")

</div>

`tap`, and the way we’re using it here, is sort of a ruby idiom. Sort of a ‘give me this thing (paths) and let me operate on that thing’ - without having to keep it as a variable or similar.

In any case - this should work for you.

```auto
OodFilesApp.candidate_favorite_paths.tap do |paths|
  paths << FavoritePath.new("/mnt/data")
end

```

This much simpler form may actually work for you, but I’m only like 80% sure without actually trying it out.

```auto
OodFilesApp.candidate_favorite_paths << FavoritePath.new("/mnt/data")

```

---

<div class="post-metadata">

**Author:** ![jdkruzr](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jdkruzr/32/650_2.png) [@jdkruzr](https://discourse.openondemand.org/u/jdkruzr)\
**Post date:** [August 4, 2022, 5:44am UTC](https://discourse.openondemand.org/t/customizing-files-app-favorites/2208/3 "2022-08-04T05:44:54Z")

</div>

Close, but “Home” is still there.

---

<div class="post-metadata">

**Author:** ![luvres](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/luvres/32/1211_2.png) [@luvres](https://discourse.openondemand.org/u/luvres)\
**Post date:** [January 28, 2023, 6:58am UTC](https://discourse.openondemand.org/t/customizing-files-app-favorites/2208/4 "2023-01-28T06:58:40Z")

</div>

In my `/etc/ood/config/apps/dashboard/initializers/ood.rb` file I have:

```auto
OodFilesApp.candidate_favorite_paths.tap do |paths|
   # add scratch space directories
   paths << Pathname.new("/fs/scratch/#{User.new.name}")
end

```

But I don’t have access to my /scratch directory in Files:  
Am I missing something?

![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bb889fea6f9c30f3dd0c2b087fa874a736bd9856.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/1/1318b2fc79d500605a9bb0076b60cf2915bdfa15.png)

---

<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:** [January 30, 2023, 4:34pm UTC](https://discourse.openondemand.org/t/customizing-files-app-favorites/2208/5 "2023-01-30T16:34:20Z")

</div>

It maybe an issue with the `Pathname`. Try `FavoritePath` instead.

```ruby
OodFilesApp.candidate_favorite_paths.tap do |paths|
   # add scratch space directories
   paths << FavoritePath.new("/fs/scratch/#{User.new.name}")
end

```

---

<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:** [July 29, 2023, 4:35pm UTC](https://discourse.openondemand.org/t/customizing-files-app-favorites/2208/6 "2023-07-29T16:35:11Z")

</div>

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