-1

I have this .haml file where I want to add glyphincon instead of showing text like I have shown below in the link_to. I have tried to look it up online and it is not working. Can someone help me out? I want the 'Show' and 'Edit' in link_to replaced by glyphicons.

%td= link_to 'Show', order

%td= link_to 'Edit', edit_order_path(order)

1 Answers1

0

You can simply put the HTML tag required for the icon you need, like so:

%td= link_to '<span class="glyphicons glyphicons-glass"></span>'.html_safe, order

The .html_safe method is necessary to avoid escaping the HTML code.

taglia
  • 1,837
  • 2
  • 13
  • 16