I wonder how to use the available methods to find the location of the file in a folder.
For building breadcrumbs, this is easy. We can do
<% if @current_folder %>
<div class="breadcrumbs">
<% if @current_folder #checking if we are under any folder %>
<%= link_to "Home", root_url %>
<% @current_folder.ancestors.reverse.each do |folder| %>
» <%= link_to folder.name, browse_path(folder) %>
<% end %>
» <%= @current_folder.name %>
<%# else #if we are not under any folder%>
<% end %>
</div>
<% end %>
but, what if i list all the files and want to show where they were created in a folder.
something like:
New File.txt =========== home/first
Second File.pdf ======== home/first/second
How to get this??