0

how can I add the following html into my link_to

<i class="icon-plus icon-white"></i>

<%= link_to 'add', '#', :class => 'btn btn-mini pull-right'%></th>  

so that the html that will be produced will look like this

<a class="btn btn-mini pull-right" href="#">
<i class="icon-plus icon-white"></i>
</a>
Aaron Dufall
  • 1,177
  • 10
  • 34

2 Answers2

1

Check out the answer to this question, where I answer pretty much this exact same thing.

Community
  • 1
  • 1
Veraticus
  • 15,944
  • 3
  • 41
  • 45
0

Check out the documentation for more info, but you have two main options. I prefer the second option, but it's up to you!

  1. Inline it.

    <%= link_to '<i class="icon-plus icon-white"></i>', '#', :class => 'btn btn-mini pull-right'%>
    
  2. Put it in a block.

    <%= link_to(@user) do %>
      <i class="icon-plus icon-white"></i>
    <% end %>