Reputation: 805
I´m new with ruby and I´m trying to insert an awesome-font icon inside a link using rails 3.2.15
This is my code
<%= link_to tweet_path(tweet), method => :delete, :confirm => 'Are you sure?' do %>
<i class="icon-trash"></i>
<% end %>
<%= link_to edit_tweet_path(tweet) do %>
<i class="icon-pencil"></i>
<% end %>
I don´t know what I'm doing wrong.
Thank you in advance.
Upvotes: 0
Views: 68
Reputation: 1921
you can do this:
<%= link_to content_tag(:i,nil, :class => "icon-trash"), tweet_path(tweet), method => :delete, :confirm => 'Are you sure?' %>
<%= link_to content_tag(:i,nil, :class => "icon-pencil"), edit_tweet_path(tweet) %>
hope this helps you
Upvotes: 1
Reputation: 19284
You can do this:
<%= link_to raw('<i class="icon-trash"></i>'), tweet_path(tweet), method => :delete, :confirm => 'Are you sure?' %>
Upvotes: 1