2014-09-02 39 views
0

在控制器後,我有回報率 - 訪問單獨創建x.times

 
def new 
@addendum = @contract.addendums.build 
    2.times do 
     @addendum.locations.build 
    end 
end 

我怎樣才能單獨訪問每個locationview form。例如,我如何製作標題第一個地點第二個地點第一個和第二個地點建成之前?在我使用的視圖形式
<% addendum.fields_for :locations do |local|%> <%= local.label :value%><%= local.number_field :value%>

回答

0

對不起,Nuno,我第一次讀你的問題,所以我刪除了我的第一個答案,並開始了。我想這個問題應該適合你:Rails: fields_for with index?