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 *.erb
must be in the record loop:
  1. <% @colors.each do |color| %>
  2.  
  3. <table>
  4. <tr>
  5. <td><%= link_to 'Show', color %></td>
  6. <td><%= link_to 'Edit', edit_color_path(color) %></td>
  7. <td><%= link_to 'Destroy', color, :confirm => 'Are you sure?', :method => :delete %></td>
  8. </tr>
  9. </table>
  10.  
  11. <% end %>

以上是关于Ruby/Rails-链接(完整元素)在视图*.erb中显示Edit Destroy Delete记录的主要内容,如果未能解决你的问题,请参考以下文章