내가 할 :ActiveRecord 개체의 배열을 저장 하시겠습니까? 내보기에서
<table border="1">
<tr>
<th>Question</th>
<th>Counter</th>
<th>Lastsent</th>
<th>Email</th>
</tr>
<% @email_stats.each do |email_stat| %>
<% post = Post.find(email_stat.postId) %>
<% if post.posttype == 'Question' %>
<tr>
<td><%= post.question %></td>
<td><%= email_stat.counter%></td>
<td><%= email_stat.lastsent %></t>
<td><%= text_field_tag 'email', email_stat.email%></td>
</tr>
<% end %>
</table>
이 내가 무엇을 가지고 : 나는 테이블의 모든 레코드를 표시하고 사회자가를 입력 할 수 있도록 할 수 있도록 일부 개체를 들어, 이메일 "빈"입니다 저장을 클릭하면 이메일이 전송됩니다.
나는 form_for
을 사용했지만 하나의 개체 만 저장하는 데 사용됩니다.
저장할 서버를 다시 배열로 보내는 가장 좋은 방법은 무엇입니까?
email_state.post 여기 뭔가 잘못되었습니다. 'post_id' 여야합니다. –