Ruby on rails ERB语法错误
是否有任何原因导致返回语法错误Ruby on rails ERB语法错误,ruby-on-rails,ruby,erb,Ruby On Rails,Ruby,Erb,是否有任何原因导致返回语法错误 <%= link_to(post), :confirm => 'Are you sure?', method: :delete, :remote => true, do %> <div>Delete</div> <% end %> 我需要在链接上设置:remote=>true,因为我正在使用Ruby gem来显示一个灯箱 更新 我也尝试过删除do之前的逗号,但我得到了相同的错误。两个问题: 您只在l
<%= link_to(post), :confirm => 'Are you sure?', method: :delete, :remote => true, do %>
<div>Delete</div>
<% end %>
我需要在链接上设置:remote=>true
,因为我正在使用Ruby gem来显示一个灯箱
更新
我也尝试过删除do之前的逗号,但我得到了相同的错误。两个问题:
link_to
函数中插入了一个参数do
之前有一个尾随逗号(如Dave所述)<%= link_to(post, confirm: 'Are you sure?', method: :delete, remote: true) do %>
<div>Delete</div>
<% end %>
删除
还是没有
<%= link_to post, confirm: 'Are you sure?', method: :delete, remote: true do %>
<div>Delete</div>
<% end %>
删除
Ah,+1;我完全没有注意到:/
<%= link_to post, confirm: 'Are you sure?', method: :delete, remote: true do %>
<div>Delete</div>
<% end %>