我正在尝试通过remote:true
方法打开表单。我打开的表单有一个@projects
变量。如何通过@projects
方法传递此link_to
变量。
<%= link_to "", project_path, remote:true, class="icon", id:"icon" %>
答案 0 :(得分:1)
您可以使用以下代码
<%= link_to "", project_path(:projects => @projects), remote: true, class: "icon", id: "icon" %>
或
<%= link_to "", project_path(projects: @projects), remote: true, class: "icon", id: "icon" %>