如何将 bootstrap 按钮放入 haml/html 文件

How to put bootstrap button in haml/html file

我的 haml 文件中有这个 link:

Delete', booking, :method => :delete, :data => { :confirm => 'Are you sure?' }

如何将它变成 bootstrap 按钮(我已经安装了正确的 gems)

我知道我需要使用 %button.btn.btn-default,但是如何使用上面的代码来实现?

你试过这个吗

link_to 'Delete', booking, :method => :delete, data => {:confirm => 'Are you sure?'}, :class => 'btn btn-default'

添加按钮 css 到 link

时可能会出现一些问题