使用 haml 的 rails 三个表单标签的正确语法

correct syntax for form tag in rails three with haml

我一直在努力让 form_tag 在 haml 工作。但是,我无法在没有意外和未定义错误等错误的情况下让它工作。因此,我想知道我是否应该为 rails 3 做一些明显不同的事情。

= form_tag url: complete_diagnostic_path(@diagnostic), html: {method: :put} do |f|

如果您查看 form_tag 的文档,则不需要 url:html:。仅使用

= form_tag complete_diagnostic_path(@diagnostic), method: :put do

应该适合你。