2011-01-29 3 views
0

나는이 :오브젝트의 속성을 호출 할 때이 추가 데이터는 어디에서 오는가? 내 HTML에서

<table class="customers" summary="User customers"> 
<%= @customers.each do |customer| %> 
<tr> 
<td class="customer"><%= customer.mobile %></td> 
<td class="timestamp">Added <%= time_ago_in_words(customer.created_at) %> ago.</td> 
</tr> 
<% end %> 
</table> 

데이터의 첫 번째 행을 읽 예상 전에

#<Customer:0x103061018>#<Customer:0x10304c910>#<Customer:0x10304c7a8>#<Customer:0x10304c668> 

: 1 일 전

5234567894 추가.
5234567893 1 일 전에 추가되었습니다.
5234567892 1 일 전에 추가되었습니다.

데이터의 첫 행은 무엇이며 어떻게 제거합니까? 대신

<%= @customers.each do |customer| %> 

답변

4

<% @customers.each do |customer| %> 

시도 (그래서 등호없이).

등호는 '< %'와 '%>'사이의 결과를 인쇄하도록 Rails에 지시하고 있습니다.

+0

아, 어리석은 실수. 감사. – Greg

관련 문제