如何在嵌套路径路径中传递id?我需要发送picture_id。
<% @histories.pictures.each do |sAV| %>
<td><div class='col-md-4 col-sm-5'> <%=image_tag sAV.pic (:medium) %></td>
<%= link_to 'Delete', history_pictures_path(histories_id: sAV.histories_id, id: pictures.id), class: 'btn btn-danger', method: :delete, data: { confirm: "Are you sure?" } %> </td>
</tr>
答案 0 :(得分:2)
<% @histories.pictures.each do |sAV| %>
<td><div class='col-md-4 col-sm-5'> <%=image_tag sAV.pic (:medium) %></td>
<%= link_to 'Delete', history_pictures_path(history_id: sAV.history_id, id: sAV.id), class: 'btn btn-danger', method: :delete, data: { confirm: "Are you sure?" } %> </td>
</tr>
<% end %>
试试这个