Is there a way to use
Rails link_to
function with fa_icon
(FontAwesome gem)
like below?
=link_to fa_icon("off"), destroy_user_session_path, :method=>'delete', {"data-toggle" => "tooltip", "data-original-title" => "Logout", "data-placement" => "bottom", :class => "btn btn-metis1 btn-sm"}
link_to (fa_icon "off"), other_options_go_here
That works for me.
This usually works fine.
<%= link_to new_message_path, :class=> "you_class" do %>
<i class="fa fa-envelope-o" aria-hidden="true" target="_blank"></i>
<% end %>
P.S any other html properties can be placed like the id, class etc. And noticed, It's better to place everything in a single line, like:
<%= link_to new_message_path, :class=> "you_class" do %><i class="fa fa-envelope-o" aria-hidden="true" target="_blank"></i><% end %>
else it outputs some character to the right, just after the icon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With