我在 index#action 中使用.each
Rails project_site
,每行显示基础模型,但是
问题是模型显示只显示project_site
每个模型显示中最后一个的 id。我想显示应该显示当前的 id project_site
。
<% @project.project_sites.where(submission_status: true).order("created_at desc").each do |project_site| %>
<tr>
<td><%= project_site.user.name %></td>
<td>
<div class="full reveal" id="exampleModal1" data-reveal>
<%= project_site.id %>
<button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button>
</div>
<p><button class="button small warning button-margin-top fi-eye" data-open="exampleModal1"> View</button></p>
</td>
</tr>
<% end %>