2

Possible Duplicate:
Best way to use Twitter Bootstrap Icons as Links in Ruby on Rails 3?

I have the following code to delete an item:

    <%= link_to "delete", sense,   :method => :delete,
                                   :confirm => "You sure?" %>

How do I attach :method and :confirm to the icon-remove used in boostrap. I want something like:

    <%= link_to <i class="icon-search"></i>, sense,   :method => :delete,
                                                      :confirm => "You sure?" %>

What is the correct way to do this?

Community
  • 1
  • 1
Zakoff
  • 12,665
  • 5
  • 22
  • 35

1 Answers1

6
<%= link_to sense, :method => :delete, :confirm => "You sure?" do %>
  <i class="icon-search"></i>
<% end %>

This should do it.

wyclin
  • 522
  • 5
  • 11