我有以下haml代码
%input{type: "button", value: "Finish"}= link_to "", stop_time_entry_path(time_entry), remote: true
点击按钮后如何访问stop_time_entries_path(time_entry)?
看起来很简单,但我无法弄清楚
答案 0 :(得分:1)
= link_to stop_time_entry_path(time_entry), remote: true do
%input{type: "button", value: "Finish"}
这是解决方案。
答案 1 :(得分:0)
有一个button_to Rails助手。试试:
button_to "Finish", stop_time_entries_path(time_entry), remote: true