Slim :: Parser :: SyntaxError预期属性

时间:2014-08-07 20:51:47

标签: ruby-on-rails slim-lang

我将Slim::Parser::SyntaxError at /conversations Expected attribute更改为a href="#"时收到错误link_to [:trash, conversation], method: :post do

这是删除复选框的动作。在ERB中我使用<%= link_to 'Move to trash', [:trash, conversation], method: :post%>

如何解决此错误?

view.html.slim:

ul.right
  li
    link_to [:trash, conversation], method: :post do
      img alt="" src="/assets/del_icon.png" /
  li
    input type="checkbox" class='select_conversations'

1 个答案:

答案 0 :(得分:1)

尝试:

= link_to 'Move to trash', [:trash, conversation], method: :post