<% @company.contacts.each do |contactall| %>
<% contactall.each do |contact| %>
<%= contact.name %>
<%= contact.position %>
<%= contact.email%>
<%= contact.telephone%>
<%= contact.source%>
<%= contact.company_id%>
<% end %>
<% end %>
它出了什么问题?
如果我取出<% contactall.each do |contact| %>
并且联系。我获得了一堆与公司关联的联系人姓名。帮助
我希望他们分开。]
修复:
<% @company.contacts.each do |contact| %>
<b>Name:</b>
<%= contact.name %>
<b>Position:</b>
<%= contact.position %>
<b>Email:</b>
<%= contact.email%>
<b>Telephone:</b>
<%= contact.telephone%>
<b>Source:</b>
<%= contact.source%><br />
<% end %>
答案 0 :(得分:1)
你是什么意思分开?此?
<% @company.contacts.each do |contact| %>
<div>
<%= contact.name %>
<%= contact.position %>
<%= contact.email%>
<%= contact.telephone%>
<%= contact.source%>
<%= contact.company_id%>
</div>
<% end %>