我知道有一种link_to
语法,您可以在块中添加一堆 html 内容以do
进行链接。但是,当我执行以下操作时:
= link_to 'Destroy', project, method: :delete, data: { confirm: 'Are you sure?' } do
%br Hello
我收到以下错误:
undefined method `stringify_keys' for #<Project:0x007fd223b0e9b8>
有人知道如何解决这个问题吗?
谢谢!
ps 这里是 View 的大背景:
- @projects.each do |project|
%tr
%td
= link_to project.name, project
%td
= link_to 'Edit', edit_project_path(project)
%td
= link_to 'Destroy', project, method: :delete, data: { confirm: 'Are you sure?' } do
%br Hello