Editing file

<%= form_for(@file) do |f| %> <%= f.error_messages %> <%= cascade @file, ["name", "size_s", "md5_s"] %>

<%= f.label :description %>
<%= f.text_field :description %>

<%= f.label :directory_id %>
<%= f.select :directory_id, Directory.all.collect{|c| ["#{c.path} - #{c.name}", c.id]} %>

<%= f.submit 'Update' %>

<% end %>

Related Files

<% @file.related_files.each do |related| %> <% end %>
Name Size Action
<%= h related.name.filename %> <%= related.size_s %> MB <%= link_to "Remove", :controller => "data_files", :action => "delFile", :id => @file, "related_id" => related %>
<%= form_for @file, :url => {:action => "addFile", :id => @file} do |f| %>

<%= f.select :related_id, @file.directory.files.not(@file).collect {|file| [file, file.id]} %> <%= f.submit "Add" %>

<% end %>
<%= link_to 'Show', @file %>