Ruby/Rails-链接(完整元素)在视图*.erb中显示Edit Destroy Delete记录
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ruby/Rails-链接(完整元素)在视图*.erb中显示Edit Destroy Delete记录相关的知识,希望对你有一定的参考价值。
links (full <a href="#"> element) to Show Edit Destroy Delete records in view *.erbmust be in the record loop:
<% @colors.each do |color| %> <table> <tr> <td><%= link_to 'Show', color %></td> <td><%= link_to 'Edit', edit_color_path(color) %></td> <td><%= link_to 'Destroy', color, :confirm => 'Are you sure?', :method => :delete %></td> </tr> </table> <% end %>
以上是关于Ruby/Rails-链接(完整元素)在视图*.erb中显示Edit Destroy Delete记录的主要内容,如果未能解决你的问题,请参考以下文章