Last Updated: February 25, 2016
·
2.793K
· geetotes

Rails link helpers, Twitter Bootstrap, and HAML

To make this:

<a href="/thing/123" class="tip-top" data-confirm="Are you sure?" data-method="delete" data-original-title="Delete" rel="nofollow">
<i class="icon-remove"></i>
</a>

From this:

= link_to 'Delete', thing, :method => :delete, :data => { :confirm => 'Are you sure?' }, :class => "btn btn-danger btn-mini"

Try this:

= link_to thing, :method => :delete, :data => { :confirm => 'Are you sure?' }, "data-original-title" => "Delete", :class => "tip-top" do
 %i.icon-remove