Try
links << {:link => link_to('<i class="icon-bar-chart"></i>'.html_safe, overview_index_path, :class => "bold"),
:active => (params[:controller] == "Overview")}
题
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.
解决方案
Try
links << {:link => link_to('<i class="icon-bar-chart"></i>'.html_safe, overview_index_path, :class => "bold"),
:active => (params[:controller] == "Overview")}