Were using the following code in /etc/ood/config/apps/dashboard/initializers/ood.rb with OnDemand 4.0.7
Rails.application.config.after_initialize do
OodFilesApp.candidate_favorite_paths.tap do |paths|
projects = User.new.groups.map(&:name)
paths.concat projects.map { |p| FavoritePath.new("/work/#{p.upcase}") }
paths << FavoritePath.new("/work")
end
end
Which produces
It appears Files renders the list in Alpha-Numeric order, regardless of the order they are inserted when calling FavoritePath.new. My question is, is there a way to force Home Directory back to the top of the list, but otherwise keep the list the same as shown. I’ve tried using a non-printable ASCII value for title: above 128
Rails.application.config.after_initialize do
OodFilesApp.candidate_favorite_paths.tap do |paths|
projects = User.new.groups.map(&:name)
paths.concat projects.map { |p| FavoritePath.new("/work/#{p.upcase}", title: 173.chr) }
paths << FavoritePath.new("/work", title: 173.chr)
end
end
Which correctly sorts, but produces a display artifact because 173.chr can’t be rendered.
I’ve tried other XXX.chr values as well as just title: “”, but without success. So, I thought I’d ask. Is there a Ruby trick (or just something I missed in the User Guide) I can use to force Home Directory back to the top of the Files list, regardless of what might be added with FavoriatePath.new.
Thanks!







