Question

I have this line in my helper method

links << {:link => link_to('Overview', overview_index_path, :class => "bold"),
              :active => (params[:controller] == "Overview")}

I want to link to a font-awesone icon instead of the text "Overview"

<i class="icon-bar-chart"></i>

I know this is something easy, but i can't remember it right now. Any help is very much appreciated.

Was it helpful?

Solution

Try

links << {:link => link_to('<i class="icon-bar-chart"></i>'.html_safe, overview_index_path, :class => "bold"),
              :active => (params[:controller] == "Overview")}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top