<%= form_for @movie, :html => { :multipart => true } do |f| %> <%= f.error_messages %> <% if @movie.file %> <%= link_to "Go to file", edit_data_file_path(@movie.file) %> <% end %>

<%= f.label :name %>
<%= f.text_field :name, {:value => @movie.file.to_s} %>

<%= f.label :category_id %>
<%= f.select :category_id, Category.ordered.collect{|c| ["#{c.domains[c.domain]} - #{c}", c.id]} %>

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

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

<%= f.label :length, "Length in seconds" %>
<%= f.text_field :length %>

<%= link_to_function 'Author', "findUser('movie[user_name]')" %>
<%= f.text_field :user_name, {:value => @movie.get_user} %>

<%= f.label :file %>
<%= f.select :file_id, DataFile.movies.collect{|d| ["#{d.name}", d.id]}, {:include_blank => true} %>

<%= f.label :preview_id %>
<%= f.select :preview_id, @movie.all_files.collect{|d| ["#{d.name}", d.id]}, {:include_blank => true} %>

<%= f.label :picture %>
<%= f.file_field :picture %>

<%= f.submit 'Save' %>

<% end %>