[英]link_to: undefined local variable or method 'post'?
我不知道我在这里缺少什么,因为该特定部分的Ruby API文档是完全垃圾...我需要将此link_to转换为POST,但是无论我做什么,都不会采用以下method: post
选项。
= link_to "Remind", "#", class: "btn green invitation-reminder", method: post
我得到错误:
undefined local variable or method `post' for #<#<Class:0x007f378f9cb738>:0x007f378faa2fd0>
我知道这可能只是一个愚蠢的语法错误,但对于Ruby和一般的Web框架,我还是很陌生,请多多包涵。 :)
传递符号 :post
而不是缺少的方法post
:
= link_to "Remind", "#", class: "btn green invitation-reminder", method: :post
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.