2013-03-11 42 views
1

我的nested_form出現問題,現在當我點擊我的link_to_add按鈕時,顯示了三種窗體......對於我所有的嵌套窗體都是一樣的,這是新的。我真的不知道原因,有什麼想法?Nested_form,link_to_add ...三次

我的代碼:

<div id="new_upload"> 

    <%= f.fields_for :uploads do |file| %> 

     <%= file.label :filename, 'Nom pièce jointe :'%> 

     <%= file.text_field :name, :size => "19", :id=>"field" %> 

     <%= file.file_field :file if file.object.new_record? %> 

     <%= file.link_to_remove "Supprimer" %> 

    <% end %> 

    </div> 

    <%= f.link_to_add "Ajouter pièce jointe", :uploads, :class=>"btn" %> 
</div> 
+0

不,請給我們提供一些幫助代碼。 – 2013-03-11 15:31:13

+0

問題更新 – eluus 2013-03-11 15:34:46

+0

不應該是'form_for:uploads do'嗎? – 2013-03-11 17:03:13

回答