Last Updated: February 25, 2016
·
1.332K
· sapienza

Custom link_to in Rails

You now that is possible pass a block to a link_to method? :)

Sometimes we need custom html markup inside our links, and here's the easiest way to it with rails routes:

<%= link_to destroy_user_session_path, class: "logout-link" do %>
  logout <i class="icon-off"></i>  
<% end %>