<%= form_for @movie, html: { multipart: true, class: 'square' } do |f| %> <%= render 'shared/errors', messages: @movie.errors.full_messages %> <% if @movie.file %> <%= link_to "View File", edit_data_file_path(@movie.file), class: 'button tiny' %> <% 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 %>
<%= f.label :user_name, "Author" %> <%= 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 %>