我想要以下行动
a href= url(:event, :destroy, event: allocation.id, company_id: company.id) title="Delete This Event" ==t 'actions.delete'
只有在我同意确认框后才能完成。我想在这个href中嵌入javascript代码:
'javascript:onClick=window.confirm("Are you SURE you want to Delete this Event?")'
我正在使用Slim。 感谢。
答案 0 :(得分:0)
如果您正在使用启用了jquery-ujs的rails,就像这样
= link_to t('actions.delete'), url, confirm: 'Are you SURE you want to Delete this Event?'