When I re-read, you would only be doing the same thing 7 times if it was an array, so suggest you try the following:
def new
@contract = Contract.new
@contract.customer_id = params[:customer_id]
7.times {
@new_contract_details = @contract.contract_details.build
@new_contract_details.del_day = "Sun"
}
end
The issue would be that at present when you call the following line, there is no indication which of the 'contract_details' objects you are trying to update.
@contract.contract_details.del_day = "Sun"