Skip to content

Instantly share code, notes, and snippets.

@guinslym
Last active January 1, 2016 10:19
Show Gist options
  • Save guinslym/8131082 to your computer and use it in GitHub Desktop.
Save guinslym/8131082 to your computer and use it in GitHub Desktop.
I want to add inside of link_to an Icon-tag I have some difficulties with adding it.
<a href="path...">
<i class="icon-home" icon-large="2x"></i>
Home
</a>
<!-- This is works but I want to add the Icon tags-->
<ul>
<% Page.all.each do |i| %>
<li><%= link_to i.name, i %></li>
<% end %>
</ul>
<!--
///////////////////
//////////
I get rid of the multiple error but not the same output
<ul>
<% Page.all.each do |i| %>
<li><%=
link_to("#", class: "") do
(i.name + content_tag(:i, "", class: "i.icon_type")).html_safe
end
%></li>
<% end %>
</ul>
this output : + Home<i class="i.icon_type"></i>
+ Services<i class="i.icon_type"></i>
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment