0
我正在尝试使用一个id和一个带有rails的类来构建一个按钮。点击按钮时会触发一个javascript事件。我尝试了不同的东西,他们都没有在所有的盒子上打勾。rails button_tag与button_to - class&id
<%= button_tag "Launch the js event", id: "button-feedback-by-bullet" %>
这工作,但没有课
<%= button_tag "Launch the js event", id: "button-feedback-by-bullet", class: "btn-primary" %>
我得到一个错误说有太多的争论
<%= button_to "Launch the js event", id: "button-feedback-by-bullet", class: "btn-primary" %>
我得到正确的类,但按键通过POST方法和js事件不会被解雇
你能帮我找到正确的语法和联合国denstand button_tag和button_to之间的细微差别?谢谢。