0
對於我的Ruby on Rails應用程序,我需要一次創建幾個LectureNote對象的可能性。我試着用這樣的觀點來做到這一點:將多個文件上傳到Ruby on Rails應用程序:第一個文件沒有上傳
<% form_for @lecture_note, :html => {:multipart => true} do %>
<%= hidden_field_tag 'thematic_block_id', params[:thematic_block_id] %>
<table>
<% (1..8).each do |i| %>
<tr>
<td><%= file_field "new_lecture_notes[][file]", 'datafile', :accept => 'application/pdf' %></td>
<td><%= text_field_tag "new_lecture_notes[][pages_per_sheet]", '', :size => 8 %></td>
<td><%= check_box_tag "new_lecture_notes[][color]", "1" %></td>
<td><%= select_date LectureNote.default_lecture_date, :order => [:day, :month, :year], :prefix => "new_lecture_notes[][lecture_date]" %></td>
</tr>
<% end %>
</table>
<%= submit_tag "Speichern" %>
<% end %>
然而,上載從未出現在params哈希表的第一個文件,第二個文件出現在這裏首先應該是,等的地方。如果我把text_field_tag放在file_field之前,它可以工作。任何想法爲什麼?